|
@@ -12,7 +12,7 @@ from format_convert import _global
|
|
|
import cv2
|
|
|
import numpy as np
|
|
|
from PIL import Image
|
|
|
-from idc.model import direction_model
|
|
|
+# from idc.model import direction_model
|
|
|
from format_convert.utils import log, get_md5_from_bytes, request_post, np2pil, bytes2np, pil2np, pil_resize, np2bytes
|
|
|
import tensorflow as tf
|
|
|
from flask import Flask, request
|
|
@@ -108,21 +108,21 @@ def _idc():
|
|
|
log("idc interface finish time " + str(time.time()-start_time))
|
|
|
|
|
|
|
|
|
-class IdcModels:
|
|
|
- def __init__(self):
|
|
|
- # python文件所在目录
|
|
|
- _dir = os.path.abspath(os.path.dirname(__file__))
|
|
|
-
|
|
|
- # detect
|
|
|
- model_path = _dir + "/models/model.h5"
|
|
|
- with sess.as_default():
|
|
|
- with sess.graph.as_default():
|
|
|
- self.model = direction_model(input_shape=(image_shape[0], image_shape[1], 3),
|
|
|
- output_shape=4)
|
|
|
- self.model.load_weights(model_path)
|
|
|
-
|
|
|
- def get_model(self):
|
|
|
- return self.model
|
|
|
+# class IdcModels:
|
|
|
+# def __init__(self):
|
|
|
+# # python文件所在目录
|
|
|
+# _dir = os.path.abspath(os.path.dirname(__file__))
|
|
|
+#
|
|
|
+# # detect
|
|
|
+# model_path = _dir + "/models/model.h5"
|
|
|
+# with sess.as_default():
|
|
|
+# with sess.graph.as_default():
|
|
|
+# self.model = direction_model(input_shape=(image_shape[0], image_shape[1], 3),
|
|
|
+# output_shape=4)
|
|
|
+# self.model.load_weights(model_path)
|
|
|
+#
|
|
|
+# def get_model(self):
|
|
|
+# return self.model
|
|
|
|
|
|
|
|
|
def test_idc_model(from_remote=False):
|