Add app and dependencies
Browse files- app.py +19 -0
- requirements.txt +3 -0
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
# Load the model
|
5 |
+
pipe = pipeline("image-classification", model="prithivMLmods/Gym-Workout-Classifier-SigLIP2")
|
6 |
+
|
7 |
+
# Inference function
|
8 |
+
def classify_image(image):
|
9 |
+
return pipe(image)
|
10 |
+
|
11 |
+
# Gradio UI
|
12 |
+
demo = gr.Interface(
|
13 |
+
fn=classify_image,
|
14 |
+
inputs=gr.Image(type="pil"),
|
15 |
+
outputs="label",
|
16 |
+
title="Gym Workout Classifier"
|
17 |
+
)
|
18 |
+
|
19 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
transformers
|
3 |
+
torch
|