Skip to content

Commit

Permalink
support-flask-rest-api
Browse files Browse the repository at this point in the history
  • Loading branch information
ccssu committed Mar 7, 2023
1 parent fd5cbeb commit 43f5d2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion utils/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def attempt_download(file, repo="Oneflow-Inc/one-yolov5", release="v1.2.0"):
# Attempt file download from GitHub release assets if not found locally. release = 'latest', 'v7.0', etc.
from utils.general import LOGGER

if file.endswith(".pt"):
if str(file).endswith(".pt"):
repo, release = "ultralytics/yolov5", "v7.0"

def github_assets(repository, version="latest"):
Expand Down
2 changes: 1 addition & 1 deletion utils/flask_rest_api/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ def predict(model):
parser.add_argument("--model", nargs="+", default=["yolov5s"], help="model(s) to run, i.e. --model yolov5n yolov5s")
opt = parser.parse_args()
for m in opt.model:
models[m] = torch.hub.load('Oneflow-Inc/one-yolov5','custom', m ,force_reload=True, skip_validation=True)
models[m] = torch.hub.load("Oneflow-Inc/one-yolov5", "custom", m, force_reload=True, skip_validation=True)

app.run(host="0.0.0.0", port=opt.port) # debug=True causes Restarting with stat

0 comments on commit 43f5d2b

Please sign in to comment.