fix 类别映射表修改

This commit is contained in:
zhouchengrong
2024-04-30 11:58:01 +08:00
parent 71f022d29d
commit 499d60fca6
2 changed files with 2 additions and 3 deletions

View File

@@ -13,6 +13,8 @@ router = APIRouter()
@router.post("")
def attribute(request_data: AttributeModel):
logger.info(f"attribute requests is @@@@@@@@@@@:{request_data}")
service = AttributeRecognition()
response = service.attribute(const, request_data)
logger.info(f"attribute response is @@@@@@@@@@@:{response}")
return {"code": 200, "message": "ok", "data": response}

View File

@@ -160,7 +160,6 @@ class AttributeRecognition:
present_dict = self.get_attribute(attr_model_path, attr_description, sample)
attr_dict = Merge(attr_dict, present_dict)
print('attr_dict: ', attr_dict)
final_dict[request_data.upload_img_id[l]] = attr_dict
return final_dict
@@ -176,7 +175,6 @@ class AttributeRecognition:
colattr = list(attr_type['labelName'])
task = attr_type['taskName'][0]
if task == 'category':
print(scores, type(scores))
maxsc = np.max(scores)
if maxsc > 0:
indexs = np.argwhere(scores == maxsc)[:, 1]
@@ -193,7 +191,6 @@ class AttributeRecognition:
else:
maxsc = np.max(scores)
print(maxsc)
if maxsc > 0:
indexs = np.argwhere(scores == maxsc)[:, 1]
else: