|
@@ -53,13 +53,35 @@ class ParamProcess(object):
|
|
case "v1":
|
|
case "v1":
|
|
result = self.model_v1(features)
|
|
result = self.model_v1(features)
|
|
result = list(result)
|
|
result = list(result)
|
|
- return result
|
|
|
|
|
|
+ if result:
|
|
|
|
+ obj = {
|
|
|
|
+ "score": result[0],
|
|
|
|
+ "benchmark": 0.06,
|
|
|
|
+ "is_good_video": result[0] > 0.06
|
|
|
|
+ }
|
|
|
|
+ else:
|
|
|
|
+ obj = {
|
|
|
|
+ "score": None,
|
|
|
|
+ "benchmark": 0.06,
|
|
|
|
+ "is_good_video": False
|
|
|
|
+ }
|
|
|
|
+ return obj
|
|
case "v2":
|
|
case "v2":
|
|
- print("predict_data", features)
|
|
|
|
result = self.model_v2.predict(features)
|
|
result = self.model_v2.predict(features)
|
|
- print("predict", list(result))
|
|
|
|
result = list(result)
|
|
result = list(result)
|
|
- return result
|
|
|
|
|
|
+ if result:
|
|
|
|
+ obj = {
|
|
|
|
+ "score": result[0],
|
|
|
|
+ "benchmark": 0.3,
|
|
|
|
+ "is_good_video": result[0] > 0.3
|
|
|
|
+ }
|
|
|
|
+ else:
|
|
|
|
+ obj = {
|
|
|
|
+ "score": None,
|
|
|
|
+ "benchmark": 0.3,
|
|
|
|
+ "is_good_video": False
|
|
|
|
+ }
|
|
|
|
+ return obj
|
|
|
|
|
|
async def process_label(self, params):
|
|
async def process_label(self, params):
|
|
"""
|
|
"""
|