This repository has been archived by the owner on Apr 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Rename File to temporary file
- Loading branch information
Patrick Kuehn
committed
Nov 5, 2019
1 parent
2c7f764
commit 8b6ecc1
Showing
9 changed files
with
22 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
import time | ||
|
||
from flask import Blueprint, jsonify, request | ||
|
||
from ..models.File import File | ||
from ..models.ZipArchive import ZipArchive | ||
from ..filesystem.TemporaryFile import TemporaryFile | ||
from ..prediction.prediction import predict | ||
from ..validation.predict import validate_predict_request | ||
from ..validation.predict_zip import validate_predict_zip_request | ||
from ..validation.validation import abort_with_errors | ||
from ..prediction.prediction import predict, predict_multiple | ||
|
||
|
||
predict_route = Blueprint("predict", __name__) | ||
|
||
|
||
@predict_route.route("/predict", methods=["POST"]) | ||
def classify_single(): | ||
"""Classify a single image""" | ||
# Validate request | ||
validate_predict_request(request) | ||
|
||
# Get File object | ||
file = File(request.files["file"]) | ||
file = TemporaryFile(request.files["file"]) | ||
|
||
# Return ziped probabilities | ||
return jsonify(predict(file)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters