Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,8 @@ from gender_classification import gender_classification
|
|
3 |
from emotion_classification import emotion_classification
|
4 |
from dog_breed import dog_breed_classification
|
5 |
from deepfake_vs_real import deepfake_classification
|
6 |
-
from gym_workout_classification import
|
|
|
7 |
|
8 |
# Functions to update the model state when a button is clicked.
|
9 |
def select_gender():
|
@@ -21,6 +22,9 @@ def select_deepfake():
|
|
21 |
def select_gym_workout():
|
22 |
return "gym workout"
|
23 |
|
|
|
|
|
|
|
24 |
# Main classification function that calls the appropriate model based on selection.
|
25 |
def classify(image, model_name):
|
26 |
if model_name == "gender":
|
@@ -33,19 +37,22 @@ def classify(image, model_name):
|
|
33 |
return deepfake_classification(image)
|
34 |
elif model_name == "gym workout":
|
35 |
return gym_workout_classification(image)
|
|
|
|
|
36 |
else:
|
37 |
return {"Error": "No model selected"}
|
38 |
|
39 |
with gr.Blocks() as demo:
|
40 |
# Sidebar with title and model selection buttons.
|
41 |
with gr.Sidebar():
|
42 |
-
gr.Markdown("# SigLIP2
|
43 |
with gr.Row():
|
44 |
gender_btn = gr.Button("Gender Classification")
|
45 |
emotion_btn = gr.Button("Emotion Classification")
|
46 |
dog_breed_btn = gr.Button("Dog Breed Classification")
|
47 |
deepfake_btn = gr.Button("Deepfake vs Real")
|
48 |
gym_workout_btn = gr.Button("Gym Workout Classification")
|
|
|
49 |
|
50 |
# State to hold the current model choice.
|
51 |
selected_model = gr.State("gender")
|
@@ -56,6 +63,7 @@ with gr.Blocks() as demo:
|
|
56 |
dog_breed_btn.click(fn=select_dog_breed, inputs=[], outputs=selected_model)
|
57 |
deepfake_btn.click(fn=select_deepfake, inputs=[], outputs=selected_model)
|
58 |
gym_workout_btn.click(fn=select_gym_workout, inputs=[], outputs=selected_model)
|
|
|
59 |
|
60 |
gr.Markdown("### Current Model:")
|
61 |
model_display = gr.Textbox(value="gender", interactive=False)
|
|
|
3 |
from emotion_classification import emotion_classification
|
4 |
from dog_breed import dog_breed_classification
|
5 |
from deepfake_vs_real import deepfake_classification
|
6 |
+
from gym_workout_classification import gym_workout_classification
|
7 |
+
from augmented_waste_classifier import waste_classification
|
8 |
|
9 |
# Functions to update the model state when a button is clicked.
|
10 |
def select_gender():
|
|
|
22 |
def select_gym_workout():
|
23 |
return "gym workout"
|
24 |
|
25 |
+
def select_waste():
|
26 |
+
return "waste"
|
27 |
+
|
28 |
# Main classification function that calls the appropriate model based on selection.
|
29 |
def classify(image, model_name):
|
30 |
if model_name == "gender":
|
|
|
37 |
return deepfake_classification(image)
|
38 |
elif model_name == "gym workout":
|
39 |
return gym_workout_classification(image)
|
40 |
+
elif model_name == "waste":
|
41 |
+
return waste_classification(image)
|
42 |
else:
|
43 |
return {"Error": "No model selected"}
|
44 |
|
45 |
with gr.Blocks() as demo:
|
46 |
# Sidebar with title and model selection buttons.
|
47 |
with gr.Sidebar():
|
48 |
+
gr.Markdown("# SigLIP2 224")
|
49 |
with gr.Row():
|
50 |
gender_btn = gr.Button("Gender Classification")
|
51 |
emotion_btn = gr.Button("Emotion Classification")
|
52 |
dog_breed_btn = gr.Button("Dog Breed Classification")
|
53 |
deepfake_btn = gr.Button("Deepfake vs Real")
|
54 |
gym_workout_btn = gr.Button("Gym Workout Classification")
|
55 |
+
waste_btn = gr.Button("Waste Classification")
|
56 |
|
57 |
# State to hold the current model choice.
|
58 |
selected_model = gr.State("gender")
|
|
|
63 |
dog_breed_btn.click(fn=select_dog_breed, inputs=[], outputs=selected_model)
|
64 |
deepfake_btn.click(fn=select_deepfake, inputs=[], outputs=selected_model)
|
65 |
gym_workout_btn.click(fn=select_gym_workout, inputs=[], outputs=selected_model)
|
66 |
+
waste_btn.click(fn=select_waste, inputs=[], outputs=selected_model)
|
67 |
|
68 |
gr.Markdown("### Current Model:")
|
69 |
model_display = gr.Textbox(value="gender", interactive=False)
|