noumanjavaid commited on
Commit
21380b4
·
verified ·
1 Parent(s): dfd7185

Update vton.py

Browse files
Files changed (1) hide show
  1. vton.py +7 -1
vton.py CHANGED
@@ -40,10 +40,16 @@ def virtual_try_on(garm_img_url, human_img_url, garment_des):
40
  input=input_data
41
  )
42
 
 
 
 
 
 
 
43
  # Save the output image
44
  output_path = "output.jpg"
45
  with open(output_path, "wb") as file:
46
- file.write(output.read())
47
 
48
  print(f"Virtual try-on complete! Output saved to {output_path}")
49
  return output_path
 
40
  input=input_data
41
  )
42
 
43
+ # The model returns a list of URLs, get the first one
44
+ output_url = output[0]
45
+
46
+ # Download the image from the URL
47
+ response = requests.get(output_url)
48
+
49
  # Save the output image
50
  output_path = "output.jpg"
51
  with open(output_path, "wb") as file:
52
+ file.write(response.content)
53
 
54
  print(f"Virtual try-on complete! Output saved to {output_path}")
55
  return output_path