-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun.py
More file actions
32 lines (24 loc) · 694 Bytes
/
run.py
File metadata and controls
32 lines (24 loc) · 694 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
28
29
30
31
32
import cv2
from utils.model_loader import ModelLoader
from utils.viewer import Viewer
MODEL_NAME = 'posenet_mobilenet_v1_100_257x257_multi_kpt_stripped.tflite'
MODEL_PATH = 'models/' + MODEL_NAME
VIEWER_SPECS = {
'WINDOW_NAME': 'Pose Estimation',
'MIRROR_IMAGE': True,
'DRAW_LINKS': True,
'POINT_COLOR': (156, 245, 66),
'LINK_COLOR': (255, 0, 76),
'THICKNESS': 1,
'THRESHOLD': 0.35,
'SCALE': 2
}
# Initialize videocapture
CAPTURE = cv2.VideoCapture(0)
# Creates model instance
model = ModelLoader(MODEL_PATH)
host = '127.0.0.1'
port = 25001
# Creates viewer instance and runs capture
viewer = Viewer(model, CAPTURE, VIEWER_SPECS, host, port)
viewer.run()