Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,8 +7,8 @@ from PIL import Image
|
|
| 7 |
from transformers import pipeline
|
| 8 |
pipe = pipeline("image-classification", "rvv-karma/Human-Action-Recognition-VIT-Base-patch16-224")
|
| 9 |
|
| 10 |
-
def classify_image(
|
| 11 |
-
image = Image.fromarray(
|
| 12 |
predictions = pipe(image)
|
| 13 |
return {prediction["label"]: prediction["score"] for prediction in predictions}
|
| 14 |
|
|
|
|
| 7 |
from transformers import pipeline
|
| 8 |
pipe = pipeline("image-classification", "rvv-karma/Human-Action-Recognition-VIT-Base-patch16-224")
|
| 9 |
|
| 10 |
+
def classify_image(input_data):
|
| 11 |
+
image = Image.fromarray(input_data.astype('uint8'), 'RGB')
|
| 12 |
predictions = pipe(image)
|
| 13 |
return {prediction["label"]: prediction["score"] for prediction in predictions}
|
| 14 |
|