FangSen9000 commited on
Commit
1d608cf
·
1 Parent(s): 58c2cba

Special cases of optimization 0. 0

Browse files
easy_dwpose/draw/__pycache__/controlnext.cpython-312.pyc CHANGED
Binary files a/easy_dwpose/draw/__pycache__/controlnext.cpython-312.pyc and b/easy_dwpose/draw/__pycache__/controlnext.cpython-312.pyc differ
 
easy_dwpose/draw/__pycache__/openpose.cpython-312.pyc CHANGED
Binary files a/easy_dwpose/draw/__pycache__/openpose.cpython-312.pyc and b/easy_dwpose/draw/__pycache__/openpose.cpython-312.pyc differ
 
easy_dwpose/draw/controlnext.py CHANGED
@@ -55,8 +55,11 @@ def draw_bodypose(canvas, candidate, subset, score, transparent=False, hide_tors
55
  conf = score[n][np.array(limbSeq[i]) - 1]
56
  if conf[0] < 0.3 or conf[1] < 0.3:
57
  continue
58
- Y = candidate[index.astype(int), 0] * float(W)
59
- X = candidate[index.astype(int), 1] * float(H)
 
 
 
60
  mX = np.mean(X)
61
  mY = np.mean(Y)
62
  length = ((X[0] - X[1]) ** 2 + (Y[0] - Y[1]) ** 2) ** 0.5
@@ -86,6 +89,8 @@ def draw_bodypose(canvas, candidate, subset, score, transparent=False, hide_tors
86
  continue
87
  x, y = candidate[index][0:2]
88
  conf = score[n][i]
 
 
89
  x = int(x * W)
90
  y = int(y * H)
91
  if transparent:
@@ -254,4 +259,4 @@ def process_pose_data(pose_data: Dict[str, Any], height: int, width: int) -> Dic
254
  processed_data['faces'] = adjusted_faces
255
  processed_data['faces_score'] = pose_data['faces_scores']
256
 
257
- return processed_data
 
55
  conf = score[n][np.array(limbSeq[i]) - 1]
56
  if conf[0] < 0.3 or conf[1] < 0.3:
57
  continue
58
+ coords = candidate[index.astype(int)]
59
+ if np.any(coords <= eps):
60
+ continue
61
+ Y = coords[:, 0] * float(W)
62
+ X = coords[:, 1] * float(H)
63
  mX = np.mean(X)
64
  mY = np.mean(Y)
65
  length = ((X[0] - X[1]) ** 2 + (Y[0] - Y[1]) ** 2) ** 0.5
 
89
  continue
90
  x, y = candidate[index][0:2]
91
  conf = score[n][i]
92
+ if x <= eps or y <= eps:
93
+ continue
94
  x = int(x * W)
95
  y = int(y * H)
96
  if transparent:
 
259
  processed_data['faces'] = adjusted_faces
260
  processed_data['faces_score'] = pose_data['faces_scores']
261
 
262
+ return processed_data
easy_dwpose/draw/openpose.py CHANGED
@@ -77,8 +77,12 @@ def draw_bodypose(canvas, candidate, subset, score=None, conf_threshold=0.3):
77
  if conf[0] < conf_threshold or conf[1] < conf_threshold:
78
  continue
79
 
80
- Y = candidate[index.astype(int), 0] * float(W)
81
- X = candidate[index.astype(int), 1] * float(H)
 
 
 
 
82
  mX = np.mean(X)
83
  mY = np.mean(Y)
84
  length = ((X[0] - X[1]) ** 2 + (Y[0] - Y[1]) ** 2) ** 0.5
 
77
  if conf[0] < conf_threshold or conf[1] < conf_threshold:
78
  continue
79
 
80
+ coords = candidate[index.astype(int)]
81
+ if np.any(coords <= eps):
82
+ continue
83
+
84
+ Y = coords[:, 0] * float(W)
85
+ X = coords[:, 1] * float(H)
86
  mX = np.mean(X)
87
  mY = np.mean(Y)
88
  length = ((X[0] - X[1]) ** 2 + (Y[0] - Y[1]) ** 2) ** 0.5
utils/__pycache__/npz_interpolation.cpython-312.pyc CHANGED
Binary files a/utils/__pycache__/npz_interpolation.cpython-312.pyc and b/utils/__pycache__/npz_interpolation.cpython-312.pyc differ