Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita0f3a50

Browse files
authored
Merge pull requestx4nth055#39 from apre/fix-typo-in-yolo-example
fix wrong case in live_yolo_opencv.py
2 parentsc14ab2b +9584d43 commita0f3a50

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎machine-learning/object-detection/live_yolo_opencv.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@
7676
x,y=boxes[i][0],boxes[i][1]
7777
w,h=boxes[i][2],boxes[i][3]
7878
# draw a bounding box rectangle and label on the image
79-
color= [int(c)forcincolors[class_ids[i]]]
79+
80+
color= [int(c)forcinCOLORS[class_ids[i]]]
8081
cv2.rectangle(image, (x,y), (x+w,y+h),color=color,thickness=thickness)
81-
text=f"{labels[class_ids[i]]}:{confidences[i]:.2f}"
82+
text=f"{LABEL[class_ids[i]]}:{confidences[i]:.2f}"
8283
# calculate text width & height to draw the transparent boxes as background of the text
8384
(text_width,text_height)=cv2.getTextSize(text,cv2.FONT_HERSHEY_SIMPLEX,fontScale=font_scale,thickness=thickness)[0]
8485
text_offset_x=x
@@ -97,4 +98,4 @@
9798
break
9899

99100
cap.release()
100-
cv2.destroyAllWindows()
101+
cv2.destroyAllWindows()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp