Skip to content

Commit

Permalink
refractor
Browse files Browse the repository at this point in the history
  • Loading branch information
Olament committed Aug 13, 2020
1 parent 385f9e7 commit 301b653
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from flask import Flask, jsonify, request

app = Flask(__name__)
class_label = json.load(open(os.path.join('web_inference', 'label.json')))
label_to_url = json.load(open(os.path.join('web_inference', 'label2url.json')))
model = torch.load(os.path.join('web_inference', 'model', 'model.pth'), map_location=torch.device('cpu'))
class_label = json.load(open(os.path.join('inference', 'label.json')))
label_to_url = json.load(open(os.path.join('inference', 'label2url.json')))
model = torch.load(os.path.join('inference', 'model', 'model.pth'), map_location=torch.device('cpu'))
model.eval()

def transform_image(image_bytes):
Expand Down Expand Up @@ -41,7 +41,7 @@ def get_prediction(image_bytes):
def index():
return 'DeepMushroom API'

# @web_inference.route('/predict', methods=['POST'])
# @inference.route('/predict', methods=['POST'])
# def predict():
# if request.method == 'POST':
# file = request.files['file']
Expand All @@ -50,5 +50,5 @@ def index():
# return jsonify(pred)


if __name__ == '__main__':
app.run(host='0.0.0.0')
# if __name__ == '__main__':
# app.run(host='0.0.0.0')
File renamed without changes.
File renamed without changes.

0 comments on commit 301b653

Please sign in to comment.