-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcollect_data.py
More file actions
27 lines (20 loc) · 847 Bytes
/
collect_data.py
File metadata and controls
27 lines (20 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import cv2
import numpy as np
from utilty import marking, collect_funcs
from utilty.collect_funcs import video
marker = marking
collector = collect_funcs.DataCollector()
if __name__ == "__main__":
holders = np.array(["Cimri","Birçok","Biraz","Çare","Boş"])
marker.create_folders(holders, video)
window_name = 'Data Collector'
cv2.namedWindow(window_name, cv2.WINDOW_NORMAL)
cv2.resizeWindow(window_name, 1280, 720)
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
with marking.mp_holistic.Holistic(min_detection_confidence=0.5, min_tracking_confidence=0.5,
model_complexity=1) as holistics:
collector.collect_data(holistics, cap, window_name, holders)
cap.release()
cv2.destroyAllWindows()