Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,6 +19,7 @@ transform = T.Compose([
|
|
| 19 |
def predict(image):
|
| 20 |
# Preprocess the image by converting the colour space to RGB
|
| 21 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
|
|
|
| 22 |
|
| 23 |
img_tensor = transform(image).unsqueeze(0) # Add batch dimension
|
| 24 |
|
|
@@ -34,7 +35,7 @@ def predict(image):
|
|
| 34 |
# Gradio interface
|
| 35 |
demo = gr.Interface(
|
| 36 |
fn=predict,
|
| 37 |
-
inputs=gr.Image(sources=["webcam"], type="
|
| 38 |
outputs="image" # Customize based on your output format
|
| 39 |
)
|
| 40 |
|
|
|
|
| 19 |
def predict(image):
|
| 20 |
# Preprocess the image by converting the colour space to RGB
|
| 21 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
| 22 |
+
print("converted the colour to RGB.")
|
| 23 |
|
| 24 |
img_tensor = transform(image).unsqueeze(0) # Add batch dimension
|
| 25 |
|
|
|
|
| 35 |
# Gradio interface
|
| 36 |
demo = gr.Interface(
|
| 37 |
fn=predict,
|
| 38 |
+
inputs=gr.Image(sources=["webcam"], type="numpy"), # Accepts image input
|
| 39 |
outputs="image" # Customize based on your output format
|
| 40 |
)
|
| 41 |
|