Spaces:
Running
Running
Update main.py
Browse files
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 |
-
|
220 |
|
221 |
-
processed_image, message = model.image_toonify(aligned_face,
|
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()
|