Skip to content

Commit 07af076

Browse files
authored
Merge pull request #29 from DropThe8bit/feat/yolo
[refactor] 객체 미탐지 시, 랜덤 페이지 전체 좌표 반환
2 parents 06468ea + fee1ee9 commit 07af076

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

everTale/app/service/yolo_service.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,17 @@ def detect_object(image_paths: List[str]) -> Dict[str, Any]:
9393
continue
9494

9595
if not candidates:
96-
return {"index": None, "url": None, "detection": None}
96+
random_idx = random.randint(0, len(urls) - 1)
97+
return {
98+
"index": random_idx + 1,
99+
"url": urls[random_idx],
100+
"detection": {
101+
"xCoordinate": 384.0,
102+
"yCoordinate": 384.0,
103+
"width": 384.0,
104+
"height": 384.0,
105+
}
106+
}
97107

98108
chosen = random.choice(candidates)
99109
return chosen

0 commit comments

Comments
 (0)