feat generate sketch 新增 服装类别识别
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user