Update main.py
Browse files
main.py
CHANGED
@@ -206,8 +206,8 @@ async def process_image(file: UploadFile = File(...), top: int = Form(...), bott
|
|
206 |
shutil.copyfileobj(file.file, buffer)
|
207 |
|
208 |
# Process the uploaded image
|
209 |
-
aligned_face, instyle, message = model.detect_and_align_image(
|
210 |
-
processed_image, message = model.image_toonify(
|
211 |
|
212 |
# Convert processed image to bytes
|
213 |
image_bytes = cv2.imencode('.jpg', processed_image)[1].tobytes()
|
|
|
206 |
shutil.copyfileobj(file.file, buffer)
|
207 |
|
208 |
# Process the uploaded image
|
209 |
+
aligned_face, instyle, message = model.detect_and_align_image("uploaded_image.jpg", top, bottom, left, right)
|
210 |
+
processed_image, message = model.image_toonify(aligned_face, instyle, model.exstyle, style_degree=0.5, style_type='cartoon1')
|
211 |
|
212 |
# Convert processed image to bytes
|
213 |
image_bytes = cv2.imencode('.jpg', processed_image)[1].tobytes()
|