Monikashyapa commited on
Commit
8a28709
·
verified ·
1 Parent(s): c513d19

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
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
- # Positional arguments only; no keyword args
 
 
 
 
49
  result_3d = hunyuan_client.predict(
50
- tryon_img, # first argument
51
- garment_img, # second argument
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