Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| import cv2 | |
| import numpy as np | |
| def process_image(img): | |
| # Process the image and overlay it onto the background | |
| img = cv2.resize(img, (480, 360)) | |
| background = cv2.imread('background.png') # This should be the path to your background image | |
| background[110:110+360, 26:26+480] = img | |
| return background | |
| iface = gr.Interface( | |
| fn=process_image, | |
| inputs=gr.inputs.Image(shape=(360, 480), source="webcam"), | |
| outputs="image", | |
| live=True, | |
| ) | |
| if __name__ == "__main__": | |
| iface.launch(inline=False) | |