Skip to content

Commit c7f6d94

Browse files
committed
Detection
1 parent 821ddc1 commit c7f6d94

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

AL_detect.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ def AL_detect(opt):
6868

6969
# Lưu thông tin về box vào 1 file
7070
for *xyxy, conf, cls in reversed(det):
71-
with open(config.info_predict_path, 'a') as f:
72-
xywh = (xyxy2xywh(torch.tensor(xyxy).view(1, 4)) / gn).view(-1).tolist() # normalized xywh)
73-
x,y,w,h = xywh
74-
data = {"class": cls.item(), "box": [x,y,w,h], "conf": conf.item()}
75-
result[path].append(data)
71+
xywh = (xyxy2xywh(torch.tensor(xyxy).view(1, 4)) / gn).view(-1).tolist() # normalized xywh)
72+
x,y,w,h = xywh
73+
data = {"class": cls.item(), "box": [x,y,w,h], "conf": conf.item()}
74+
result[path].append(data)
7675
# Print time (inference + NMS)
7776
print(f'{s}Done. ({t2 - t1:.3f}s)')
7877
print(f'Done. ({time.time() - t0:.3f}s)')

0 commit comments

Comments
 (0)