josedolot commited on
Commit
0a9682f
·
1 Parent(s): 2b78f5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -7,8 +7,14 @@ os.system('mkdir weights')
7
  os.system('curl -L -o weights/hybridnets.pth https://github.com/datvuthanh/HybridNets/releases/download/v1.0/hybridnets.pth')
8
 
9
  def inference(img):
 
 
 
 
 
10
 
11
  img.save("demo/image/1.jpg", "JPEG")
 
12
  #os.system('python hybridnets_test.py -w weights/hybridnets.pth --source demo/image --output demo_result --imshow False --imwrite True --cuda False')
13
  os.system('python hybridnets_test.py -w weights/hybridnets.pth --source demo/image --output demo_result --imshow False --imwrite True --cuda False --float16 False')
14
 
 
7
  os.system('curl -L -o weights/hybridnets.pth https://github.com/datvuthanh/HybridNets/releases/download/v1.0/hybridnets.pth')
8
 
9
  def inference(img):
10
+
11
+ basewidth = 1280
12
+ wpercent = (basewidth/float(img.size[0]))
13
+ hsize = int((float(img.size[1])*float(wpercent)))
14
+ img = img.resize((basewidth,hsize), Image.ANTIALIAS)
15
 
16
  img.save("demo/image/1.jpg", "JPEG")
17
+
18
  #os.system('python hybridnets_test.py -w weights/hybridnets.pth --source demo/image --output demo_result --imshow False --imwrite True --cuda False')
19
  os.system('python hybridnets_test.py -w weights/hybridnets.pth --source demo/image --output demo_result --imshow False --imwrite True --cuda False --float16 False')
20