@@ -2741,10 +2741,11 @@ def extract(image):
27412741 return json .dumps ({'result' : result })
27422742
27432743@deepeye .task
2744- def extract_image_feature_only (image ):
2744+ def extract_v2 (image ):
27452745 global e_sess
27462746 global e_graph
2747- print (">>> extract() {} " .format (image ))
2747+ # print(">>> extract() {} ".format(image))
2748+ imgstring = image ["base64data" ]
27482749 imgpath = image ["path" ]
27492750 style = image ["style" ]
27502751 blury = image ["blury" ]
@@ -2756,22 +2757,23 @@ def extract_image_feature_only(image):
27562757
27572758 if current_groupid is None :
27582759 return json .dumps ({"embedding_path" :"" })
2759- embedding = featureCalculation2 ( imgpath )
2760+ embedding = FaceProcessing . FaceProcessingBase64ImageData2 ( imgstring )
27602761 if embedding is not None :
27612762 if type (trackerid ) is not str :
27622763 trackerid = str (trackerid )
27632764
27642765 embedding_path = save_embedding .get_embedding_path (imgpath )
2765- save_embedding .create_embedding_string (embedding , embedding_path )
2766+ embedding_str = save_embedding .convert_embedding_to_string (embedding )
27662767
2767- return json .dumps ({'embedding_path' : embedding_path })
2768+ return json .dumps ({'embedding_path' : embedding_path , 'embedding_str' : embedding_str })
27682769
27692770@deepeye .task
2770- def classify_on_embedding_file (image ):
2771+ def classify (image ):
27712772 global e_sess
27722773 global e_graph
27732774 print (">>> extract() {} " .format (image ))
2774- embedding_path = image ["path" ]
2775+ embedding_path = image ["embedding_path" ]
2776+ imgpath = image ["path" ]
27752777 style = image ["style" ]
27762778 blury = image ["blury" ]
27772779 ts = image ["ts" ]
@@ -2790,15 +2792,16 @@ def classify_on_embedding_file(image):
27902792 if embedding_path is not None :
27912793 if type (trackerid ) is not str :
27922794 trackerid = str (trackerid )
2793-
2794- result = face_recognition_on_embedding (None , None , totalPeople , blury , uuid , current_groupid , style , trackerid , timestamp1 , ts , embedding_path )
2795+ embedding = save_embedding .read_embedding_string (embedding_path )
2796+ embedding = np .asarray (embedding )
2797+ result = face_recognition_on_embedding (imgpath , embedding , totalPeople , blury , uuid , current_groupid , style , trackerid , timestamp1 , ts , embedding_path )
27952798
27962799 return json .dumps ({'result' : result })
27972800
27982801deepeye .conf .task_routes = {
27992802 'upload_api-v2.extract' : {'queue' : 'embedding' },
2800- 'upload_api-v2.extract_image_feature_only ' : {'queue' : 'embedding' },
2801- 'upload_api-v2.classify_on_embedding_file ' : {'queue' : 'classify ' }
2803+ 'upload_api-v2.extract_v2 ' : {'queue' : 'embedding' },
2804+ 'upload_api-v2.classify ' : {'queue' : 'embedding ' }
28022805}
28032806
28042807
0 commit comments