Spaces:
Runtime error
Runtime error
remove print debug
Browse files
app.py
CHANGED
|
@@ -73,18 +73,15 @@ def image_changed(image):
|
|
| 73 |
if image == None:
|
| 74 |
return "estimation", {}
|
| 75 |
|
| 76 |
-
print(js.dumps(image.info, indent=2))
|
| 77 |
if 'openpose' in image.info:
|
| 78 |
print("pose found")
|
| 79 |
jsonText = image.info['openpose']
|
| 80 |
-
print(jsonText)
|
| 81 |
jsonObj = js.loads(jsonText)
|
| 82 |
subset = jsonObj['subset']
|
| 83 |
return f"""{image.width}px x {image.height}px, {len(subset)} indivisual(s)""", jsonText
|
| 84 |
else:
|
| 85 |
print("pose not found")
|
| 86 |
candidate, subset = body_estimation(pil2cv(image))
|
| 87 |
-
print(subset.shape)
|
| 88 |
jsonText = "{ \"candidate\": " + candidate_to_json_string(candidate) + ", \"subset\": " + subset_to_json_string(subset) + " }"
|
| 89 |
return f"""{image.width}px x {image.height}px, {subset.shape[0]} indivisual(s)""", jsonText
|
| 90 |
|
|
|
|
| 73 |
if image == None:
|
| 74 |
return "estimation", {}
|
| 75 |
|
|
|
|
| 76 |
if 'openpose' in image.info:
|
| 77 |
print("pose found")
|
| 78 |
jsonText = image.info['openpose']
|
|
|
|
| 79 |
jsonObj = js.loads(jsonText)
|
| 80 |
subset = jsonObj['subset']
|
| 81 |
return f"""{image.width}px x {image.height}px, {len(subset)} indivisual(s)""", jsonText
|
| 82 |
else:
|
| 83 |
print("pose not found")
|
| 84 |
candidate, subset = body_estimation(pil2cv(image))
|
|
|
|
| 85 |
jsonText = "{ \"candidate\": " + candidate_to_json_string(candidate) + ", \"subset\": " + subset_to_json_string(subset) + " }"
|
| 86 |
return f"""{image.width}px x {image.height}px, {subset.shape[0]} indivisual(s)""", jsonText
|
| 87 |
|