Sa-m commited on
Commit
30dbf30
·
1 Parent(s): 4da76c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  """
2
  Run a rest API exposing the yolov5s object detection model
3
  """
4
- import argparse
5
  import io
6
  import torch
7
  from flask import Flask, request
@@ -14,6 +14,9 @@ DETECTION_URL = "/v1/detect"
14
 
15
  @app.route('/')
16
  def predict():
 
 
 
17
  if not request.method == "POST":
18
  return
19
 
@@ -28,5 +31,4 @@ def predict():
28
 
29
 
30
  if __name__ == "__main__":
31
- model = torch.hub.load('ultralytics/yolov5', 'custom', path='best2.pt', force_reload=True) # force_reload to recache
32
  app.run(host="0.0.0.0", port=7860) # debug=True causes Restarting with stat
 
1
  """
2
  Run a rest API exposing the yolov5s object detection model
3
  """
4
+
5
  import io
6
  import torch
7
  from flask import Flask, request
 
14
 
15
  @app.route('/')
16
  def predict():
17
+
18
+ model = torch.hub.load('ultralytics/yolov5', 'custom', path='best2.pt', force_reload=True) # force_reload to recache
19
+
20
  if not request.method == "POST":
21
  return
22
 
 
31
 
32
 
33
  if __name__ == "__main__":
 
34
  app.run(host="0.0.0.0", port=7860) # debug=True causes Restarting with stat