Ashrafb commited on
Commit
ad35e65
·
verified ·
1 Parent(s): ae49289

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -216,9 +216,9 @@ async def process_image(file: UploadFile = File(...), top: int = Form(...), bott
216
 
217
  # Process the uploaded image
218
  aligned_face, instyle, message = model.detect_and_align_image("uploaded_image.jpg", top, bottom, left, right)
219
- instyle_dict = {'instyle': instyle.numpy()} # Convert instyle to a dictionary containing a NumPy array
220
 
221
- processed_image, message = model.image_toonify(aligned_face, instyle_dict, model.exstyle, style_degree=0.5, style_type='cartoon3-d')
222
 
223
  # Convert processed image to bytes
224
  image_bytes = cv2.imencode('.jpg', processed_image)[1].tobytes()
 
216
 
217
  # Process the uploaded image
218
  aligned_face, instyle, message = model.detect_and_align_image("uploaded_image.jpg", top, bottom, left, right)
219
+ instyle_np = instyle['instyle'] # Extract the NumPy array from the dictionary
220
 
221
+ processed_image, message = model.image_toonify(aligned_face, instyle_np, model.exstyle, style_degree=0.5, style_type='illustration1-d')
222
 
223
  # Convert processed image to bytes
224
  image_bytes = cv2.imencode('.jpg', processed_image)[1].tobytes()