Spaces:
Sleeping
Sleeping
Update process_frame.py
Browse files- process_frame.py +16 -16
process_frame.py
CHANGED
|
@@ -24,11 +24,11 @@ class ProcessFrame:
|
|
| 24 |
'red' : (255, 50, 50),
|
| 25 |
'green' : (0, 255, 127),
|
| 26 |
'light_green': (100, 233, 127),
|
| 27 |
-
'
|
| 28 |
'magenta' : (255, 0, 255),
|
| 29 |
'white' : (255,255,255),
|
| 30 |
'cyan' : (0, 255, 255),
|
| 31 |
-
'
|
| 32 |
}
|
| 33 |
|
| 34 |
# Dictionary to maintain the various landmark features.
|
|
@@ -174,7 +174,7 @@ class ProcessFrame:
|
|
| 174 |
display_inactivity = True
|
| 175 |
|
| 176 |
cv2.circle(frame, nose_coord, 7, self.COLORS['white'], -1)
|
| 177 |
-
cv2.circle(frame, left_shldr_coord, 7, self.COLORS['
|
| 178 |
cv2.circle(frame, right_shldr_coord, 7, self.COLORS['magenta'], -1)
|
| 179 |
|
| 180 |
if self.flip_frame:
|
|
@@ -304,21 +304,21 @@ class ProcessFrame:
|
|
| 304 |
|
| 305 |
|
| 306 |
# Join landmarks.
|
| 307 |
-
cv2.line(frame, shldr_coord, elbow_coord, self.COLORS['
|
| 308 |
-
cv2.line(frame, wrist_coord, elbow_coord, self.COLORS['
|
| 309 |
-
cv2.line(frame, shldr_coord, hip_coord, self.COLORS['
|
| 310 |
-
cv2.line(frame, knee_coord, hip_coord, self.COLORS['
|
| 311 |
-
cv2.line(frame, ankle_coord, knee_coord,self.COLORS['
|
| 312 |
-
cv2.line(frame, ankle_coord, foot_coord, self.COLORS['
|
| 313 |
|
| 314 |
# Plot landmark points
|
| 315 |
-
cv2.circle(frame, shldr_coord, 7, self.COLORS['
|
| 316 |
-
cv2.circle(frame, elbow_coord, 7, self.COLORS['
|
| 317 |
-
cv2.circle(frame, wrist_coord, 7, self.COLORS['
|
| 318 |
-
cv2.circle(frame, hip_coord, 7, self.COLORS['
|
| 319 |
-
cv2.circle(frame, knee_coord, 7, self.COLORS['
|
| 320 |
-
cv2.circle(frame, ankle_coord, 7, self.COLORS['
|
| 321 |
-
cv2.circle(frame, foot_coord, 7, self.COLORS['
|
| 322 |
|
| 323 |
|
| 324 |
|
|
|
|
| 24 |
'red' : (255, 50, 50),
|
| 25 |
'green' : (0, 255, 127),
|
| 26 |
'light_green': (100, 233, 127),
|
| 27 |
+
'orange' : (252, 83, 5),
|
| 28 |
'magenta' : (255, 0, 255),
|
| 29 |
'white' : (255,255,255),
|
| 30 |
'cyan' : (0, 255, 255),
|
| 31 |
+
'off_white' : (221, 226, 237)
|
| 32 |
}
|
| 33 |
|
| 34 |
# Dictionary to maintain the various landmark features.
|
|
|
|
| 174 |
display_inactivity = True
|
| 175 |
|
| 176 |
cv2.circle(frame, nose_coord, 7, self.COLORS['white'], -1)
|
| 177 |
+
cv2.circle(frame, left_shldr_coord, 7, self.COLORS['orange'], -1)
|
| 178 |
cv2.circle(frame, right_shldr_coord, 7, self.COLORS['magenta'], -1)
|
| 179 |
|
| 180 |
if self.flip_frame:
|
|
|
|
| 304 |
|
| 305 |
|
| 306 |
# Join landmarks.
|
| 307 |
+
cv2.line(frame, shldr_coord, elbow_coord, self.COLORS['off_white'], 4, lineType=self.linetype)
|
| 308 |
+
cv2.line(frame, wrist_coord, elbow_coord, self.COLORS['off_white'], 4, lineType=self.linetype)
|
| 309 |
+
cv2.line(frame, shldr_coord, hip_coord, self.COLORS['off_white'], 4, lineType=self.linetype)
|
| 310 |
+
cv2.line(frame, knee_coord, hip_coord, self.COLORS['off_white'], 4, lineType=self.linetype)
|
| 311 |
+
cv2.line(frame, ankle_coord, knee_coord,self.COLORS['off_white'], 4, lineType=self.linetype)
|
| 312 |
+
cv2.line(frame, ankle_coord, foot_coord, self.COLORS['off_white'], 4, lineType=self.linetype)
|
| 313 |
|
| 314 |
# Plot landmark points
|
| 315 |
+
cv2.circle(frame, shldr_coord, 7, self.COLORS['orange'], -1, lineType=self.linetype)
|
| 316 |
+
cv2.circle(frame, elbow_coord, 7, self.COLORS['orange'], -1, lineType=self.linetype)
|
| 317 |
+
cv2.circle(frame, wrist_coord, 7, self.COLORS['orange'], -1, lineType=self.linetype)
|
| 318 |
+
cv2.circle(frame, hip_coord, 7, self.COLORS['orange'], -1, lineType=self.linetype)
|
| 319 |
+
cv2.circle(frame, knee_coord, 7, self.COLORS['orange'], -1, lineType=self.linetype)
|
| 320 |
+
cv2.circle(frame, ankle_coord, 7, self.COLORS['orange'], -1, lineType=self.linetype)
|
| 321 |
+
cv2.circle(frame, foot_coord, 7, self.COLORS['orange'], -1, lineType=self.linetype)
|
| 322 |
|
| 323 |
|
| 324 |
|