feat generate sketch 新增 服装类别识别

This commit is contained in:
zhouchengrong
2024-04-24 13:25:17 +08:00
parent 679c854b01
commit 123fecbf72
3 changed files with 13 additions and 4 deletions

View File

@@ -162,7 +162,7 @@ def stain_detection(image, spot_size=200):
return True, image
def generate_category_recognition(image):
def generate_category_recognition(image, gender):
def preprocess(img):
img = mmcv.imread(img)
# ori_shape = img.shape[:2]
@@ -196,5 +196,12 @@ def generate_category_recognition(image):
maxsc = np.max(scores[0][:5])
indexs = np.argwhere(scores == maxsc)[:, 1]
category = colattr[indexs[0]]
return category, scores, image
if gender == "Male":
if category == 'Trousers' or category == 'Skirt':
category = 'Bottoms'
elif category == 'Blouse' or category == 'Dress':
category = 'Tops'
else:
category = 'Outwear'
return category, scores, image