|
@@ -7,6 +7,7 @@
|
|
|
'''
|
|
|
import cv2
|
|
|
import torch
|
|
|
+import time
|
|
|
import numpy as np
|
|
|
from ultralytics import YOLO
|
|
|
from shapely.geometry.polygon import Polygon
|
|
@@ -243,6 +244,8 @@ if __name__ == "__main__":
|
|
|
result = instance(image)
|
|
|
if len(result)>0 and time.time()-posttime>30:
|
|
|
videoTime = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime())
|
|
|
+ filename = videoTime + ".jpg"
|
|
|
+ filenameori = videoTime + "det.jpg"
|
|
|
logger.info(videoTime)
|
|
|
logger.info(result)
|
|
|
for res in result:
|
|
@@ -255,7 +258,7 @@ if __name__ == "__main__":
|
|
|
'classIndex': '8',
|
|
|
'ip': '172.19.152.231',
|
|
|
'videoTime': videoTime,
|
|
|
- 'videoUrl': video}
|
|
|
+ 'videoUrl': stream.stream_url}
|
|
|
files = [
|
|
|
('file', (filename, content, 'image/jpeg')),
|
|
|
('oldFile', (filenameori, contentori, 'image/jpeg')),
|