AIOmarRehan commited on
Commit
aaaa2cf
·
verified ·
1 Parent(s): 91b1e2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -33,7 +33,6 @@ def preprocess_image(img, target_size=(225, 225)):
33
  return img_array
34
 
35
  def classify_sports_ball(image):
36
- """Classify sports ball in image"""
37
  try:
38
  # Preprocess
39
  input_tensor = preprocess_image(image)
@@ -58,7 +57,6 @@ def classify_sports_ball(image):
58
  return {"error": str(e)}
59
 
60
  def load_random_dataset_image():
61
- """Load a random image from HuggingFace dataset"""
62
  try:
63
  dataset = load_dataset("AIOmarRehan/Sports-Balls", split="test", trust_remote_code=True)
64
  random_idx = random.randint(0, len(dataset) - 1)
@@ -139,7 +137,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
139
  gr.Examples(
140
  examples=[],
141
  inputs=image_input,
142
- label="Example Images (if available)",
143
  run_on_click=False
144
  )
145
 
 
33
  return img_array
34
 
35
  def classify_sports_ball(image):
 
36
  try:
37
  # Preprocess
38
  input_tensor = preprocess_image(image)
 
57
  return {"error": str(e)}
58
 
59
  def load_random_dataset_image():
 
60
  try:
61
  dataset = load_dataset("AIOmarRehan/Sports-Balls", split="test", trust_remote_code=True)
62
  random_idx = random.randint(0, len(dataset) - 1)
 
137
  gr.Examples(
138
  examples=[],
139
  inputs=image_input,
140
+ label="Example Images (Available)",
141
  run_on_click=False
142
  )
143