Spaces:
Configuration error
Configuration error
Commit
·
49ecb98
1
Parent(s):
3024054
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,16 +44,16 @@ def Detection(filename):
|
|
| 44 |
if len(classIds) != 0:
|
| 45 |
for classId, confidence,box in zip(classIds.flatten(),confs.flatten(),bbox):
|
| 46 |
|
| 47 |
-
cv2.rectangle(img,box,color=(0,255,0),thickness=2)
|
| 48 |
-
cv2.putText(img,classNames[classId-1].upper(),(box[0]+10,box[1]+30),
|
| 49 |
-
cv2.FONT_HERSHEY_COMPLEX,1,(0,255,0),2)
|
| 50 |
-
cv2.putText(img,str(round(confidence*100,2)),(box[0]+200,box[1]+30),
|
| 51 |
-
cv2.FONT_HERSHEY_COMPLEX,1,(0,255,0),2)
|
| 52 |
if FinalItems.count(classNames[classId-1]) == 0:
|
| 53 |
FinalItems.append(classNames[classId-1])
|
| 54 |
|
| 55 |
|
| 56 |
-
cv2.imshow("Output",img)
|
| 57 |
cv2.waitKey(10)
|
| 58 |
except Exception as err:
|
| 59 |
print(err)
|
|
|
|
| 44 |
if len(classIds) != 0:
|
| 45 |
for classId, confidence,box in zip(classIds.flatten(),confs.flatten(),bbox):
|
| 46 |
|
| 47 |
+
#cv2.rectangle(img,box,color=(0,255,0),thickness=2)
|
| 48 |
+
#cv2.putText(img,classNames[classId-1].upper(),(box[0]+10,box[1]+30),
|
| 49 |
+
#cv2.FONT_HERSHEY_COMPLEX,1,(0,255,0),2)
|
| 50 |
+
#cv2.putText(img,str(round(confidence*100,2)),(box[0]+200,box[1]+30),
|
| 51 |
+
#cv2.FONT_HERSHEY_COMPLEX,1,(0,255,0),2)
|
| 52 |
if FinalItems.count(classNames[classId-1]) == 0:
|
| 53 |
FinalItems.append(classNames[classId-1])
|
| 54 |
|
| 55 |
|
| 56 |
+
#cv2.imshow("Output",img)
|
| 57 |
cv2.waitKey(10)
|
| 58 |
except Exception as err:
|
| 59 |
print(err)
|