fix 类别映射表修改
This commit is contained in:
@@ -13,6 +13,8 @@ router = APIRouter()
|
|||||||
|
|
||||||
@router.post("")
|
@router.post("")
|
||||||
def attribute(request_data: AttributeModel):
|
def attribute(request_data: AttributeModel):
|
||||||
|
logger.info(f"attribute requests is @@@@@@@@@@@:{request_data}")
|
||||||
service = AttributeRecognition()
|
service = AttributeRecognition()
|
||||||
response = service.attribute(const, request_data)
|
response = service.attribute(const, request_data)
|
||||||
|
logger.info(f"attribute response is @@@@@@@@@@@:{response}")
|
||||||
return {"code": 200, "message": "ok", "data": response}
|
return {"code": 200, "message": "ok", "data": response}
|
||||||
|
|||||||
@@ -160,7 +160,6 @@ class AttributeRecognition:
|
|||||||
present_dict = self.get_attribute(attr_model_path, attr_description, sample)
|
present_dict = self.get_attribute(attr_model_path, attr_description, sample)
|
||||||
attr_dict = Merge(attr_dict, present_dict)
|
attr_dict = Merge(attr_dict, present_dict)
|
||||||
|
|
||||||
print('attr_dict: ', attr_dict)
|
|
||||||
final_dict[request_data.upload_img_id[l]] = attr_dict
|
final_dict[request_data.upload_img_id[l]] = attr_dict
|
||||||
return final_dict
|
return final_dict
|
||||||
|
|
||||||
@@ -176,7 +175,6 @@ class AttributeRecognition:
|
|||||||
colattr = list(attr_type['labelName'])
|
colattr = list(attr_type['labelName'])
|
||||||
task = attr_type['taskName'][0]
|
task = attr_type['taskName'][0]
|
||||||
if task == 'category':
|
if task == 'category':
|
||||||
print(scores, type(scores))
|
|
||||||
maxsc = np.max(scores)
|
maxsc = np.max(scores)
|
||||||
if maxsc > 0:
|
if maxsc > 0:
|
||||||
indexs = np.argwhere(scores == maxsc)[:, 1]
|
indexs = np.argwhere(scores == maxsc)[:, 1]
|
||||||
@@ -193,7 +191,6 @@ class AttributeRecognition:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
maxsc = np.max(scores)
|
maxsc = np.max(scores)
|
||||||
print(maxsc)
|
|
||||||
if maxsc > 0:
|
if maxsc > 0:
|
||||||
indexs = np.argwhere(scores == maxsc)[:, 1]
|
indexs = np.argwhere(scores == maxsc)[:, 1]
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user