From 3bcae4c2cfbef73cac81cedbbe74426f17d90099 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 1 Jun 2020 19:49:46 +0200 Subject: flask app runs and js compiles --- cli/app/controllers/upload_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/app/controllers/upload_controller.py') diff --git a/cli/app/controllers/upload_controller.py b/cli/app/controllers/upload_controller.py index 5463fc6..86f9f29 100644 --- a/cli/app/controllers/upload_controller.py +++ b/cli/app/controllers/upload_controller.py @@ -4,7 +4,7 @@ from werkzeug.datastructures import MultiDict from werkzeug.utils import secure_filename import os import numpy as np -import cv2 as cv +from PIL import Image from app.settings import app_cfg from app.sql.common import db, Session @@ -77,7 +77,7 @@ class UploadView(FlaskView): # decode image try: - im = cv.imdecode(nparr, cv.IMREAD_COLOR) + im = Image.fromarray(nparr) except: return jsonify({ 'status': 'error', 'error': 'Image parse error' }) -- cgit v1.2.3-70-g09d2