project
This commit is contained in:
commit
7221ce886e
1
detection.ipynb
Normal file
1
detection.ipynb
Normal file
File diff suppressed because one or more lines are too long
29
mask_realtime.py
Normal file
29
mask_realtime.py
Normal file
@ -0,0 +1,29 @@
|
||||
import cv2
|
||||
from importlib.resources import path
|
||||
from time import time
|
||||
import torch
|
||||
from matplotlib import pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
|
||||
|
||||
model_name='last.pt'
|
||||
model = torch.hub.load('C:/Users/Lenovo/Documents/Downloads/yolov5/yolov5', 'custom', source='local', path ='C:/Users/Lenovo/Documents/Downloads/yolov5/yolov5/runs/train/exp16/weights/best.pt')
|
||||
cap= cv2.VideoCapture(0)
|
||||
|
||||
while cap.isOpened():
|
||||
start= time()
|
||||
ret, frame = cap.read()
|
||||
result= model(frame)
|
||||
cv2.imshow('My Face', np.squeeze(result.render()))
|
||||
if cv2.waitKey(10) & 0xff == ord('x'):
|
||||
break
|
||||
if cv2.getWindowProperty('My Face', cv2.WND_PROP_VISIBLE) < 1:
|
||||
break
|
||||
|
||||
end = time()
|
||||
fps = 1/(end - start)
|
||||
|
||||
|
||||
cap.release()
|
||||
cv2.destroyAllWindows()
|
1
process_data
Normal file
1
process_data
Normal file
File diff suppressed because one or more lines are too long
BIN
real_time_test/My Face 2023-02-01 19-53-32_Trim.mp4
Normal file
BIN
real_time_test/My Face 2023-02-01 19-53-32_Trim.mp4
Normal file
Binary file not shown.
1
training.ipynb
Normal file
1
training.ipynb
Normal file
File diff suppressed because one or more lines are too long
1
yolo.ipynb
Normal file
1
yolo.ipynb
Normal file
@ -0,0 +1 @@
|
||||
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyNgHWJCYsUG/AycWvwhePJv"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[]}
|
1
yolov5
Submodule
1
yolov5
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 064365d8683fd002e9ad789c1e91fa3d021b44f0
|
Loading…
Reference in New Issue
Block a user