ArchiMathur commited on
Commit
ed12aa1
·
verified ·
1 Parent(s): 26d18d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -8,20 +8,20 @@ from ultralytics import YOLO
8
  model = YOLO("best.pt") # Ensure the path to your model is correct
9
 
10
  webcamera = cv2.VideoCapture(0)
11
- # webcamera.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
12
- # webcamera.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
13
 
14
- while True:
15
- success, frame = webcamera.read()
16
 
17
- results = model.track(frame, classes=0, conf=0.8, imgsz=480)
18
- cv2.putText(frame, f"Total: {len(results[0].boxes)}", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2, cv2.LINE_AA)
19
- cv2.imshow("Live Camera", results[0].plot())
20
 
21
- if cv2.waitKey(1) == ord('q'):
22
- break
23
 
24
- webcamera.release()
25
- cv2.destroyAllWindows()
26
 
27
 
 
8
  model = YOLO("best.pt") # Ensure the path to your model is correct
9
 
10
  webcamera = cv2.VideoCapture(0)
11
+ # # webcamera.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
12
+ # # webcamera.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
13
 
14
+ # while True:
15
+ # success, frame = webcamera.read()
16
 
17
+ # results = model.track(frame, classes=0, conf=0.8, imgsz=480)
18
+ # cv2.putText(frame, f"Total: {len(results[0].boxes)}", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2, cv2.LINE_AA)
19
+ # cv2.imshow("Live Camera", results[0].plot())
20
 
21
+ # if cv2.waitKey(1) == ord('q'):
22
+ # break
23
 
24
+ # webcamera.release()
25
+ # cv2.destroyAllWindows()
26
 
27