yolo.py 649 Bytes

# insert at 1, 0 is the script path (or '' in REPL)
#sys.path.insert(1, '/yolov5-5.0.5')


# import subprocess
import os

# # YOLO Setting
# model_path = "./best.pt" # it automatically downloads yolov5s model to given path
# device = "cpu" # or "cpu"
# yolov5 = YOLOv5(model_path, device)

# # ts file to mp4 file
# ts_file = 'sample.ts'
# mp4_file = 'sample.mp4'
# subprocess.run(['ffmpeg', '-i', ts_file, mp4_file])

#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from yolo_module.yolov5.detect import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())