Commit bb2c3df0 authored by sikhin.vc's avatar sikhin.vc

Update yolov7_multiprocessing_videos.py

parent 4a0fe7b8
......@@ -2,10 +2,8 @@
import time
import multiprocessing
from multiprocessing import Process
#from torch.multiprocessing import Pool, Process, set_start_method
from yolov7_trt import YoLov7TRT
import cv2
#print(torch.cuda.is_available())
engine_file_path = "build/yolov7.engine"
yolo_v7_wrapper = YoLov7TRT(engine_file_path)
......@@ -17,20 +15,16 @@ def detectObject(video,name):
if img is None:
break
else:
print("image shape")
print(img.shape)
result_boxes, result_scores, result_classid = yolo_v7_wrapper.infer(img)
print(str(result_classid), str(name))
cTime = time.time()
print("fps", str(1/(cTime - pTime)))
#cv2.imshow(name, cv2.resize(img, (600, 300)))
#cv2.waitKey(1)
cap.release()
try:
#set_start_method('spawn', force=True)
multiprocessing.set_start_method('spawn')
except RuntimeError:
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment