ducngg commited on
Commit
9313dfd
1 Parent(s): 09e2869

Update app.py and reqs

Browse files
Files changed (2) hide show
  1. app.py +4 -4
  2. requirements.txt +1 -1
app.py CHANGED
@@ -3,11 +3,11 @@ import torch
3
  from ultralytics import YOLO
4
 
5
  torch.hub.download_url_to_file(
6
- 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftexashafts.com%2Fwp-content%2Fuploads%2F2016%2F04%2Fconstruction-worker.jpg', 'one.jpg')
7
  torch.hub.download_url_to_file(
8
- 'https://www.pearsonkoutcherlaw.com/wp-content/uploads/2020/06/Construction-Workers.jpg', 'two.jpg')
9
  torch.hub.download_url_to_file(
10
- 'https://nssgroup.com/wp-content/uploads/2019/02/Building-maintenance-blog.jpg', 'three.jpg')
11
 
12
 
13
  def handle_classify(image: gr.inputs.Image = None):
@@ -29,7 +29,7 @@ def handle_classify(image: gr.inputs.Image = None):
29
 
30
  print(top5)
31
 
32
- return top5
33
 
34
 
35
  inputs = [
 
3
  from ultralytics import YOLO
4
 
5
  torch.hub.download_url_to_file(
6
+ 'http://www.imesclub.org/images/stories/arabidentity.jpeg', 'one.jpg')
7
  torch.hub.download_url_to_file(
8
+ 'https://lp-cms-production.imgix.net/2023-08/GettyImages-1224548888-16.9.jpg', 'two.jpg')
9
  torch.hub.download_url_to_file(
10
+ 'https://s.wsj.net/public/resources/images/OB-EQ974_diwali_G_20091014112400.jpg', 'three.jpg')
11
 
12
 
13
  def handle_classify(image: gr.inputs.Image = None):
 
29
 
30
  print(top5)
31
 
32
+ return "\n".join(["\t".join(row) for row in top5])
33
 
34
 
35
  inputs = [
requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
  torch
2
- gradio
3
  ultralytics
 
1
  torch
2
+ gradio==4.14.0
3
  ultralytics