本文主要是介绍flask 和fastdeploy 快速部署 yolov3,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
服务端
from flask import Flask,request,render_template
from flask import session,redirect,jsonify
import cv2
import numpy as np
import base64
import os
import fastdeploy as fd
import datetime,timeapp=Flask(__name__)from logging import config,getLogger
logger=getLogger('WebAPI')def get_image_data():"""将客户端传入的图片数据(base64字符串格式)转成numpy.ndarray格式"""params = request.jsonif not params["images"]: # 列表为空return "No image received, please check"img = params["images"]try:img = base64.b64decode(img)img = np.frombuffer(img, np.uint8)img = cv2.imdecode(img, cv2.IMREAD_COLOR)except Exception as e:print(e)return "Not valid image type!"return imgdef cv2_to_base64(image, img_type=".bmp"):"""将cv2 numpy ndarray格式的图片数据转成s
这篇关于flask 和fastdeploy 快速部署 yolov3的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!