Ashrafb commited on
Commit
4a60381
·
verified ·
1 Parent(s): 60ffb70

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -191,8 +191,8 @@ async def process_image(file: UploadFile = File(...), top: int = Form(...), bott
191
  shutil.copyfileobj(file.file, buffer)
192
 
193
  # Process the uploaded image
194
- aligned_face, instyle, message = model.detect_and_align_image("uploaded_image.jpg", top, bottom, left, right)
195
- processed_image, message = model.image_toonify(aligned_face, instyle, model.exstyle, style_degree=0.5, style_type='cartoon1')
196
 
197
  # Convert processed image to bytes
198
  image_bytes = cv2.imencode('.jpg', processed_image)[1].tobytes()
 
191
  shutil.copyfileobj(file.file, buffer)
192
 
193
  # Process the uploaded image
194
+ aligned_face, instyle, message = detect_and_align_image("uploaded_image.jpg", top, bottom, left, right)
195
+ processed_image, message = image_toonify(aligned_face, instyle, exstyle, style_degree=0.5, style_type='cartoon1')
196
 
197
  # Convert processed image to bytes
198
  image_bytes = cv2.imencode('.jpg', processed_image)[1].tobytes()