Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,10 +45,14 @@ def tryon_to_3d(person_img, garment_img, seed, randomize_seed):
|
|
| 45 |
return None, "Try-on failed"
|
| 46 |
|
| 47 |
try:
|
| 48 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
result_3d = hunyuan_client.predict(
|
| 50 |
-
|
| 51 |
-
|
| 52 |
fn_index=fn_index_default
|
| 53 |
)
|
| 54 |
return result_3d, tryon_info
|
|
|
|
| 45 |
return None, "Try-on failed"
|
| 46 |
|
| 47 |
try:
|
| 48 |
+
# Convert NumPy arrays to PNG bytes
|
| 49 |
+
_, tryon_bytes = cv2.imencode('.png', tryon_img)
|
| 50 |
+
_, garment_bytes = cv2.imencode('.png', garment_img)
|
| 51 |
+
|
| 52 |
+
# Send bytes (Hunyuan3D Gradio API accepts file-like input)
|
| 53 |
result_3d = hunyuan_client.predict(
|
| 54 |
+
tryon_bytes.tobytes(),
|
| 55 |
+
garment_bytes.tobytes(),
|
| 56 |
fn_index=fn_index_default
|
| 57 |
)
|
| 58 |
return result_3d, tryon_info
|