Skip to content

Commit

Permalink
🐛 Fix normalization issue (#1913)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Aug 13, 2023
1 parent d67f31a commit 50b5436
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
8 changes: 0 additions & 8 deletions annotator/openpose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ def chunks(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i + n]

def normalize_keypoint(keypoint: Keypoint) -> Keypoint:
return Keypoint(
keypoint.x / width,
keypoint.y / height
)

def decompress_keypoints(numbers: Optional[List[float]]) -> Optional[List[Optional[Keypoint]]]:
if not numbers:
return None
Expand All @@ -103,8 +97,6 @@ def create_keypoint(x, y, c):
if c < 1.0:
return None
keypoint = Keypoint(x, y)
if normalize_coords:
keypoint = normalize_keypoint(keypoint)
return keypoint

return [
Expand Down
4 changes: 1 addition & 3 deletions scripts/controlnet_ui/openpose_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ def register_callbacks(
):
def render_pose(pose_url: str) -> Tuple[Dict, Dict]:
json_string = parse_data_url(pose_url)
poses, height, weight = decode_json_as_poses(
json_string, normalize_coords=True
)
poses, height, weight = decode_json_as_poses(json_string)
return (
# Generated image.
gr.update(
Expand Down

0 comments on commit 50b5436

Please sign in to comment.