ishworrsubedii commited on
Commit
014a185
·
verified ·
1 Parent(s): bb48dce

Update src/api/nto_api.py

Browse files
Files changed (1) hide show
  1. src/api/nto_api.py +3 -5
src/api/nto_api.py CHANGED
@@ -132,12 +132,10 @@ async def clothing_try_on(image: UploadFile = File(...),
132
  }
133
 
134
  output = replicate_run_cto(input)
135
- print(output)
136
- print("Output0",output[0])
137
- image_base = str(output[0])
138
 
139
- image_base_64 = image_base.split(",")[1]
140
- image_data = base64.b64decode(image_base_64)
 
141
 
142
  output_image = Image.open(BytesIO(image_data)).resize(actual_image.size)
143
  output_image = np.bitwise_and(
 
132
  }
133
 
134
  output = replicate_run_cto(input)
 
 
 
135
 
136
+ response = requests.get(output[0])
137
+
138
+ image_data = base64.b64encode(response.content).decode('utf-8')
139
 
140
  output_image = Image.open(BytesIO(image_data)).resize(actual_image.size)
141
  output_image = np.bitwise_and(