하면서 나오는 여러 의견들을 여기에 자유롭게 적어보세요.
package com.example.accidentdetectionservice.domain.accident.dto;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@NoArgsConstructor
public class AccidentRequestDto {
private Boolean accident; // 사고가 발생했는지 1 or 0
private String latitude; // 위도
private String longitude; // 경도
private String date; // -> ex) 2024-02-14 14:00:00
private Long severityLevel; -> String accurracy
private String severity; -> String sorting
}
**+ Png Image**
// ai 서버로부터 이미지와 사고 데이터를 동시에 받는 경우
// 사고 데이터의 경우 json 객체가 아니라 String 객체임
@PostMapping(value = "/receiving-data", consumes = "multipart/form-data")
public ResponseEntity<MessageResponseDto> processFileAndData(@RequestParam("image") MultipartFile image,
@RequestParam("requestDto") String requestDtoJson,
@AuthenticationPrincipal UserDetailsImpl userDetails) {
try {
AccidentRequestDto requestDto = objectMapper.readValue(requestDtoJson, AccidentRequestDto.class);
byte[] imageBytes = image.getBytes();
return ResponseEntity.ok(accidentService.processFileAndData(imageBytes, requestDto, userDetails.getUser()));
} catch (Exception e) {
throw new IllegalArgumentException("Error Processing the image");
}
}
→ issue 가 될만한게 png 이미지랑 + json 데이터를 동시에 보냄(String Type)
→ AI: 1. 모델 학습, 영상 돌려서 정보 보내는 이미지 → string으로 보내기
Average frame processing time: 0.1319 seconds → 초당 7.5장 처리가능 → 초당 15프레임 사용시 점점 밀림
1안) 검사 최적화 알고리즘 짜기 (non accident면 n→n+5프레임 단위로 검사(초당 3프레임) accidnet면 n→n+1검사)
2안) 초당 7프레임만 검사
1안 채택….
생각을 자유롭게 적어보세요.