diff --git a/app/api/api_attribute.py b/app/api/api_attribute.py index 81f163b..213a1a9 100644 --- a/app/api/api_attribute.py +++ b/app/api/api_attribute.py @@ -14,6 +14,5 @@ router = APIRouter() @router.post("") def attribute(request_data: AttributeModel): service = AttributeRecognition() - response = service.attribute(const_debug, request_data) - logger.info("test") + response = service.attribute(const, request_data) return {"code": 200, "message": "ok", "data": response} diff --git a/app/api/api_outfit_matcher.py b/app/api/api_outfit_matcher.py index 24a6337..4532b0c 100644 --- a/app/api/api_outfit_matcher.py +++ b/app/api/api_outfit_matcher.py @@ -1,10 +1,13 @@ import logging import time +from copy import deepcopy from fastapi import APIRouter +from pymilvus import MilvusClient + from app.schemas.outfit_matcher import OutfitMatcher from app.service.outfit_matcher.dataset import FashionDataset -from app.service.outfit_matcher.outfit_evaluator import OutfitMaterTypeAware +from app.service.outfit_matcher.outfit_evaluator import OutfitMaterTypeAware, Backbone from app.service.utils.decorator import RunTime logger = logging.getLogger() @@ -19,16 +22,28 @@ def outfit_matcher(request_item: OutfitMatcher): request_item['query'][i] = dict(request_item['query'][i]) for i in range(len(request_item['database'])): request_item['database'][i] = dict(request_item['database'][i]) - - # try: fashion_dataset = FashionDataset(request_item['database']) + backbone_service = Backbone() service = OutfitMaterTypeAware() + all_items = request_item["query"] + request_item["database"] + prepared_feature = {} + extracted_features = backbone_service.get_result(all_items) + data = deepcopy(all_items) # 做深拷贝 , all_items 是list 可变数组 + for i, feature in enumerate(extracted_features): + data[i]['features'] = feature + if 'mapped_cate' in data[i].keys(): + del data[i]['mapped_cate'] + + client = MilvusClient(uri="http://10.1.1.240:19530", token="root:Milvus", db_name="mixi") + res = client.insert(collection_name="mixi_outfit", data=data) + client.close() + for d in data: + prepared_feature[d['item_name']] = d['features'] result = [] start_time = time.time() for item in request_item['query']: outfits = fashion_dataset.generate_outfit(item, request_item["topk"], request_item["max_outfits"]) - scores, features = service.get_result(outfits) - # save features in databases + scores = service.get_result(outfits, prepared_feature) if request_item['is_best']: best_outfits, best_scores = service.visualize(outfits, scores, request_item["topk"], best=True, @@ -44,4 +59,4 @@ def outfit_matcher(request_item: OutfitMatcher): return {"message": "ok", "data": result} # except Exception as e: # logger.warning(e) - # return {"message": f"{e}", "data": e} \ No newline at end of file + # return {"message": f"{e}", "data": e} diff --git a/app/core/config.py b/app/core/config.py index fb7c00d..8338d65 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -27,23 +27,25 @@ MINIO_SECURE = False MINIO_ACCESS = "e8zc55mzDOh4IzRrZ9Oa" MINIO_SECRET = "uHfqJ7UkwA1PTDGfnA44Hp9ux5YkZTkzZLjeOYhE" -OM_TRITON_IP = "127.0.0.1" -OM_TRITON_PORT = "8000" -# OM_TRITON_IP = "10.1.1.240" -# OM_TRITON_PORT = "10010" +OM_TRITON_IP = "10.1.1.240" +OM_TRITON_PORT = "10010" ATT_TRITON_IP = "10.1.1.240" ATT_TRITON_PORT = "10020" -# service env -# LOGS_PATH = "app/logs/errors.log" -# FASHION_CATEGORIES = "app/service/outfit_matcher/config/fashion_categories.json" -# FASHION_CATEGORIES_MAPPING = "app/service/outfit_matcher/config/fashion_category_mapping.json" +DEBUG = 1 +# service env : 1 +# pycharm debug : 2 -# pycharm debug -LOGSPATH = "logs/errors.log" -FASHION_CATEGORIES = "config/fashion_categories.json" -FASHION_CATEGORIES_MAPPING = "config/fashion_category_mapping.json" -# LOGS_PATH = "logs/errors.log" -# FASHION_CATEGORIES = "service/outfit_matcher/config/fashion_categories.json" -# FASHION_CATEGORIES_MAPPING = "service/outfit_matcher/config/fashion_category_mapping.json" +if DEBUG == 1: + LOGS_PATH = "app/logs/errors.log" + FASHION_CATEGORIES = "app/service/outfit_matcher/config/fashion_categories.json" + FASHION_CATEGORIES_MAPPING = "app/service/outfit_matcher/config/fashion_category_mapping.json" +elif DEBUG == 2: + LOGS_PATH = "logs/errors.log" + FASHION_CATEGORIES = "service/outfit_matcher/config/fashion_categories.json" + FASHION_CATEGORIES_MAPPING = "service/outfit_matcher/config/fashion_category_mapping.json" +elif DEBUG == 3: + LOGS_PATH = "app/logs/errors.log" + FASHION_CATEGORIES = "./config/fashion_categories.json" + FASHION_CATEGORIES_MAPPING = "./config/fashion_category_mapping.json" diff --git a/app/service/attribute_recognition/discriptor/bottom/2_bottom_subtype.csv b/app/service/attribute_recognition/discriptor/bottom/2_bottom_subtype.csv index 7cb9fb2..dd7de88 100644 --- a/app/service/attribute_recognition/discriptor/bottom/2_bottom_subtype.csv +++ b/app/service/attribute_recognition/discriptor/bottom/2_bottom_subtype.csv @@ -1,21 +1,21 @@ labelName,join_attr,taskName,taskId -A Line Skirt,bottom_Sub-Type_1,Sub_Type,2 -Bodycon Skirt,bottom_Sub-Type_2,Sub_Type,2 -Boot-Cut,bottom_Sub-Type_3,Sub_Type,2 -Bubble skirt,bottom_Sub-Type_4,Sub_Type,2 -Cargo Pants,bottom_Sub-Type_5,Sub_Type,2 -Culottes,bottom_Sub-Type_6,Sub_Type,2 -Handkerchief Skirt,bottom_Sub-Type_7,Sub_Type,2 -Jeans,bottom_Sub-Type_8,Sub_Type,2 -Joggers,bottom_Sub-Type_9,Sub_Type,2 -Leather pants,bottom_Sub-Type_10,Sub_Type,2 -Leggings,bottom_Sub-Type_11,Sub_Type,2 -Mermaid,bottom_Sub-Type_12,Sub_Type,2 -Pattened pants,bottom_Sub-Type_13,Sub_Type,2 -Peg leg Pants-Cigarette Pants,bottom_Sub-Type_14,Sub_Type,2 -Pencil Skirt,bottom_Sub-Type_15,Sub_Type,2 -Pleated Skirt,bottom_Sub-Type_16,Sub_Type,2 -Shorts,bottom_Sub-Type_17,Sub_Type,2 -Skater Skirt,bottom_Sub-Type_18,Sub_Type,2 -Suit Trousers,bottom_Sub-Type_19,Sub_Type,2 -Tier Skirt,bottom_Sub-Type_20,Sub_Type,2 +A Line Skirt,bottom_Sub-Type_1,Sub type2 +Bodycon Skirt,bottom_Sub-Type_2,Sub type2 +Boot-Cut,bottom_Sub-Type_3,Sub type2 +Bubble skirt,bottom_Sub-Type_4,Sub type2 +Cargo Pants,bottom_Sub-Type_5,Sub type2 +Culottes,bottom_Sub-Type_6,Sub type2 +Handkerchief Skirt,bottom_Sub-Type_7,Sub type2 +Jeans,bottom_Sub-Type_8,Sub type2 +Joggers,bottom_Sub-Type_9,Sub type2 +Leather pants,bottom_Sub-Type_10,Sub type2 +Leggings,bottom_Sub-Type_11,Sub type2 +Mermaid,bottom_Sub-Type_12,Sub type2 +Pattened pants,bottom_Sub-Type_13,Sub type2 +Peg leg Pants-Cigarette Pants,bottom_Sub-Type_14,Sub type2 +Pencil Skirt,bottom_Sub-Type_15,Sub type2 +Pleated Skirt,bottom_Sub-Type_16,Sub type2 +Shorts,bottom_Sub-Type_17,Sub type2 +Skater Skirt,bottom_Sub-Type_18,Sub type2 +Suit Trousers,bottom_Sub-Type_19,Sub type2 +Tier Skirt,bottom_Sub-Type_20,Sub type2 diff --git a/app/service/attribute_recognition/discriptor/bottom/7_bottom_OPType.csv b/app/service/attribute_recognition/discriptor/bottom/7_bottom_OPType.csv index 008d981..d699ba9 100644 --- a/app/service/attribute_recognition/discriptor/bottom/7_bottom_OPType.csv +++ b/app/service/attribute_recognition/discriptor/bottom/7_bottom_OPType.csv @@ -1,6 +1,6 @@ labelName,join_attr,taskName,taskId -Button,attr_OPType_B_1,Opening_Type,7 -Zipper,attr_OPType_B_2,Opening_Type,7 -Thread,attr_OPType_B_3,Opening_Type,7 -Hook,attr_OPType_B_4,Opening_Type,7 -Elastic,attr_OPType_B_5,Opening_Type,7 +Button,attr_OPType_B_1,Opening type,7 +Zipper,attr_OPType_B_2,Opening type,7 +Thread,attr_OPType_B_3,Opening type,7 +Hook,attr_OPType_B_4,Opening type,7 +Elastic,attr_OPType_B_5,Opening type,7 diff --git a/app/service/attribute_recognition/discriptor/bottom/ori9_bottom_OPType.csv b/app/service/attribute_recognition/discriptor/bottom/ori9_bottom_OPType.csv index 5aaef17..2530262 100644 --- a/app/service/attribute_recognition/discriptor/bottom/ori9_bottom_OPType.csv +++ b/app/service/attribute_recognition/discriptor/bottom/ori9_bottom_OPType.csv @@ -1,6 +1,6 @@ labelName,join_attr,taskName,taskId -Button,attr_OPType_B_1,Opening_Type,9 -Zipper,attr_OPType_B_2,Opening_Type,9 -Thread,attr_OPType_B_3,Opening_Type,9 -Hook,attr_OPType_B_4,Opening_Type,9 -Elastic,attr_OPType_B_5,Opening_Type,9 +Button,attr_OPType_B_1,Opening type,9 +Zipper,attr_OPType_B_2,Opening type,9 +Thread,attr_OPType_B_3,Opening type,9 +Hook,attr_OPType_B_4,Opening type,9 +Elastic,attr_OPType_B_5,Opening type,9 diff --git a/app/service/attribute_recognition/discriptor/dress/11_top_OPType.csv b/app/service/attribute_recognition/discriptor/dress/11_top_OPType.csv index 870631b..34a3934 100644 --- a/app/service/attribute_recognition/discriptor/dress/11_top_OPType.csv +++ b/app/service/attribute_recognition/discriptor/dress/11_top_OPType.csv @@ -1,5 +1,5 @@ labelName,join_attr,taskName,taskId -Button,attr_OPType_U_1,Opening_Type,11 -Zipper,attr_OPType_U_2,Opening_Type,11 -Thread,attr_OPType_U_3,Opening_Type,11 -Hook,attr_OPType_U_4,Opening_Type,11 +Button,attr_OPType_U_1,Opening type,11 +Zipper,attr_OPType_U_2,Opening type,11 +Thread,attr_OPType_U_3,Opening type,11 +Hook,attr_OPType_U_4,Opening type,11 diff --git a/app/service/attribute_recognition/discriptor/dress/3_top_Sleeve_length.csv b/app/service/attribute_recognition/discriptor/dress/3_top_Sleeve_length.csv index 1f2a0f3..cb9e969 100644 --- a/app/service/attribute_recognition/discriptor/dress/3_top_Sleeve_length.csv +++ b/app/service/attribute_recognition/discriptor/dress/3_top_Sleeve_length.csv @@ -1,6 +1,6 @@ labelName,join_attr,taskName,taskId -Sleeveless,attr_Sleeve_length_1,Sleeve_Length,3 -Short,attr_Sleeve_length_2,Sleeve_Length,3 -Middle,attr_Sleeve_length_3,Sleeve_Length,3 -Seven,attr_Sleeve_length_4,Sleeve_Length,3 -Long,attr_Sleeve_length_5,Sleeve_Length,3 +Sleeveless,attr_Sleeve_length_1,Sleeve length,3 +Short,attr_Sleeve_length_2,Sleeve length,3 +Middle,attr_Sleeve_length_3,Sleeve length,3 +Seven,attr_Sleeve_length_4,Sleeve length,3 +Long,attr_Sleeve_length_5,Sleeve length,3 diff --git a/app/service/attribute_recognition/discriptor/dress/4_top_Sleeve_shape.csv b/app/service/attribute_recognition/discriptor/dress/4_top_Sleeve_shape.csv index d429c11..2c53b12 100644 --- a/app/service/attribute_recognition/discriptor/dress/4_top_Sleeve_shape.csv +++ b/app/service/attribute_recognition/discriptor/dress/4_top_Sleeve_shape.csv @@ -1,9 +1,9 @@ labelName,join_attr,taskName,taskId -Regular,attr_Sleeve_shape_1,Sleeve_Shape,4 -Slim,attr_Sleeve_shape_2,Sleeve_Shape,4 -Puff,attr_Sleeve_shape_3,Sleeve_Shape,4 -Bell,attr_Sleeve_shape_4,Sleeve_Shape,4 -Batwing,attr_Sleeve_shape_5,Sleeve_Shape,4 -Shirt,attr_Sleeve_shape_6,Sleeve_Shape,4 -Rib,attr_Sleeve_shape_7,Sleeve_Shape,4 -Raglan,attr_Sleeve_shape_8,Sleeve_Shape,4 +Regular,attr_Sleeve_shape_1,Sleeve shape,4 +Slim,attr_Sleeve_shape_2,Sleeve shape,4 +Puff,attr_Sleeve_shape_3,Sleeve shape,4 +Bell,attr_Sleeve_shape_4,Sleeve shape,4 +Batwing,attr_Sleeve_shape_5,Sleeve shape,4 +Shirt,attr_Sleeve_shape_6,Sleeve shape,4 +Rib,attr_Sleeve_shape_7,Sleeve shape,4 +Raglan,attr_Sleeve_shape_8,Sleeve shape,4 diff --git a/app/service/attribute_recognition/discriptor/dress/5_top_Sleeve_shoulder.csv b/app/service/attribute_recognition/discriptor/dress/5_top_Sleeve_shoulder.csv index c31e7ea..7997bd5 100644 --- a/app/service/attribute_recognition/discriptor/dress/5_top_Sleeve_shoulder.csv +++ b/app/service/attribute_recognition/discriptor/dress/5_top_Sleeve_shoulder.csv @@ -1,5 +1,5 @@ labelName,join_attr,taskName,taskId -Regular,attr_Sleeve_shoulder_1,Sleeve_Shoulder,5 -Cold,attr_Sleeve_shoulder_2,Sleeve_Shoulder,5 -Tucked,attr_Sleeve_shoulder_3,Sleeve_Shoulder,5 -Balmain,attr_Sleeve_shoulder_4,Sleeve_Shoulder,5 +Regular,attr_Sleeve_shoulder_1,Sleeve shoulder,5 +Cold,attr_Sleeve_shoulder_2,Sleeve shoulder,5 +Tucked,attr_Sleeve_shoulder_3,Sleeve shoulder,5 +Balmain,attr_Sleeve_shoulder_4,Sleeve shoulder,5 diff --git a/app/service/attribute_recognition/discriptor/dress/ori11_dress_OPType.csv b/app/service/attribute_recognition/discriptor/dress/ori11_dress_OPType.csv index 34be31e..46d7e52 100644 --- a/app/service/attribute_recognition/discriptor/dress/ori11_dress_OPType.csv +++ b/app/service/attribute_recognition/discriptor/dress/ori11_dress_OPType.csv @@ -1,5 +1,5 @@ labelName,join_attr,taskName,taskId -Button,attr_OPType_D_1,Opening_Type,11 -Zipper,attr_OPType_D_2,Opening_Type,11 -Thread,attr_OPType_D_3,Opening_Type,11 -Hook,attr_OPType_D_4,Opening_Type,11 +Button,attr_OPType_D_1,Opening type,11 +Zipper,attr_OPType_D_2,Opening type,11 +Thread,attr_OPType_D_3,Opening type,11 +Hook,attr_OPType_D_4,Opening type,11 diff --git a/app/service/attribute_recognition/discriptor/dress/ori2_dress_Sleeve_length.csv b/app/service/attribute_recognition/discriptor/dress/ori2_dress_Sleeve_length.csv index 14a2dc5..0617b9f 100644 --- a/app/service/attribute_recognition/discriptor/dress/ori2_dress_Sleeve_length.csv +++ b/app/service/attribute_recognition/discriptor/dress/ori2_dress_Sleeve_length.csv @@ -1,6 +1,6 @@ labelName,join_attr,taskName,taskId -Sleeveless,attr_Sleeve_length_D_1,Sleeve_Length,2 -Short,attr_Sleeve_length_D_2,Sleeve_Length,2 -Middle,attr_Sleeve_length_D_3,Sleeve_Length,2 -Seven,attr_Sleeve_length_D_4,Sleeve_Length,2 -Long,attr_Sleeve_length_D_5,Sleeve_Length,2 +Sleeveless,attr_Sleeve_length_D_1,Sleeve length,2 +Short,attr_Sleeve_length_D_2,Sleeve length,2 +Middle,attr_Sleeve_length_D_3,Sleeve length,2 +Seven,attr_Sleeve_length_D_4,Sleeve length,2 +Long,attr_Sleeve_length_D_5,Sleeve length,2 diff --git a/app/service/attribute_recognition/discriptor/dress/ori3_dress_Sleeve_shape.csv b/app/service/attribute_recognition/discriptor/dress/ori3_dress_Sleeve_shape.csv index 7277acf..d82300f 100644 --- a/app/service/attribute_recognition/discriptor/dress/ori3_dress_Sleeve_shape.csv +++ b/app/service/attribute_recognition/discriptor/dress/ori3_dress_Sleeve_shape.csv @@ -1,9 +1,9 @@ labelName,join_attr,taskName,taskId -Regular,attr_Sleeve_shape_D_1,Sleeve_Shape,3 -Slim,attr_Sleeve_shape_D_2,Sleeve_Shape,3 -Puff,attr_Sleeve_shape_D_3,Sleeve_Shape,3 -Bell,attr_Sleeve_shape_D_4,Sleeve_Shape,3 -Batwing,attr_Sleeve_shape_D_5,Sleeve_Shape,3 -Shirt,attr_Sleeve_shape_D_6,Sleeve_Shape,3 -Rib,attr_Sleeve_shape_D_7,Sleeve_Shape,3 -Raglan,attr_Sleeve_shape_D_8,Sleeve_Shape,3 +Regular,attr_Sleeve_shape_D_1,Sleeve shape,3 +Slim,attr_Sleeve_shape_D_2,Sleeve shape,3 +Puff,attr_Sleeve_shape_D_3,Sleeve shape,3 +Bell,attr_Sleeve_shape_D_4,Sleeve shape,3 +Batwing,attr_Sleeve_shape_D_5,Sleeve shape,3 +Shirt,attr_Sleeve_shape_D_6,Sleeve shape,3 +Rib,attr_Sleeve_shape_D_7,Sleeve shape,3 +Raglan,attr_Sleeve_shape_D_8,Sleeve shape,3 diff --git a/app/service/attribute_recognition/discriptor/dress/ori4_dress_Sleeve_shoulder.csv b/app/service/attribute_recognition/discriptor/dress/ori4_dress_Sleeve_shoulder.csv index 36656f8..3e7b813 100644 --- a/app/service/attribute_recognition/discriptor/dress/ori4_dress_Sleeve_shoulder.csv +++ b/app/service/attribute_recognition/discriptor/dress/ori4_dress_Sleeve_shoulder.csv @@ -1,5 +1,5 @@ labelName,join_attr,taskName,taskId -Regular,attr_Sleeve_shoulder_D_1,Sleeve_Shoulder,4 -Cold,attr_Sleeve_shoulder_D_2,Sleeve_Shoulder,4 -Tucked,attr_Sleeve_shoulder_D_3,Sleeve_Shoulder,4 -Balmain,attr_Sleeve_shoulder_D_4,Sleeve_Shoulder,4 +Regular,attr_Sleeve_shoulder_D_1,Sleeve shoulder,4 +Cold,attr_Sleeve_shoulder_D_2,Sleeve shoulder,4 +Tucked,attr_Sleeve_shoulder_D_3,Sleeve shoulder,4 +Balmain,attr_Sleeve_shoulder_D_4,Sleeve shoulder,4 diff --git a/app/service/attribute_recognition/discriptor/jumpsuit/11_jumpsuit_OPType.csv b/app/service/attribute_recognition/discriptor/jumpsuit/11_jumpsuit_OPType.csv index 7e8fa63..b5a296c 100644 --- a/app/service/attribute_recognition/discriptor/jumpsuit/11_jumpsuit_OPType.csv +++ b/app/service/attribute_recognition/discriptor/jumpsuit/11_jumpsuit_OPType.csv @@ -1,5 +1,5 @@ labelName,join_attr,taskName,taskId -Button,attr_OPType_J_1,Opening_Type,11 -Zipper,attr_OPType_J_2,Opening_Type,11 -Thread,attr_OPType_J_3,Opening_Type,11 -Hook,attr_OPType_J_4,Opening_Type,11 +Button,attr_OPType_J_1,Opening type,11 +Zipper,attr_OPType_J_2,Opening type,11 +Thread,attr_OPType_J_3,Opening type,11 +Hook,attr_OPType_J_4,Opening type,11 diff --git a/app/service/attribute_recognition/discriptor/jumpsuit/2_jumpsuit_Sleeve_length.csv b/app/service/attribute_recognition/discriptor/jumpsuit/2_jumpsuit_Sleeve_length.csv index 7d77d7a..8c2f510 100644 --- a/app/service/attribute_recognition/discriptor/jumpsuit/2_jumpsuit_Sleeve_length.csv +++ b/app/service/attribute_recognition/discriptor/jumpsuit/2_jumpsuit_Sleeve_length.csv @@ -1,6 +1,6 @@ labelName,join_attr,taskName,taskId -Sleeveless,attr_Sleeve_length_J_1,Sleeve_Length,2 -Short,attr_Sleeve_length_J_2,Sleeve_Length,2 -Middle,attr_Sleeve_length_J_3,Sleeve_Length,2 -Seven,attr_Sleeve_length_J_4,Sleeve_Length,2 -Long,attr_Sleeve_length_J_5,Sleeve_Length,2 +Sleeveless,attr_Sleeve_length_J_1,Sleeve length,2 +Short,attr_Sleeve_length_J_2,Sleeve length,2 +Middle,attr_Sleeve_length_J_3,Sleeve length,2 +Seven,attr_Sleeve_length_J_4,Sleeve length,2 +Long,attr_Sleeve_length_J_5,Sleeve length,2 diff --git a/app/service/attribute_recognition/discriptor/jumpsuit/3_jumpsuit_Sleeve_shape.csv b/app/service/attribute_recognition/discriptor/jumpsuit/3_jumpsuit_Sleeve_shape.csv index c1a9cce..101fcb4 100644 --- a/app/service/attribute_recognition/discriptor/jumpsuit/3_jumpsuit_Sleeve_shape.csv +++ b/app/service/attribute_recognition/discriptor/jumpsuit/3_jumpsuit_Sleeve_shape.csv @@ -1,9 +1,9 @@ labelName,join_attr,taskName,taskId -Regular,attr_Sleeve_shape_J_1,Sleeve_Shape,3 -Slim,attr_Sleeve_shape_J_2,Sleeve_Shape,3 -Puff,attr_Sleeve_shape_J_3,Sleeve_Shape,3 -Bell,attr_Sleeve_shape_J_4,Sleeve_Shape,3 -Batwing,attr_Sleeve_shape_J_5,Sleeve_Shape,3 -Shirt,attr_Sleeve_shape_J_6,Sleeve_Shape,3 -Rib,attr_Sleeve_shape_J_7,Sleeve_Shape,3 -Raglan,attr_Sleeve_shape_J_8,Sleeve_Shape,3 +Regular,attr_Sleeve_shape_J_1,Sleeve shape,3 +Slim,attr_Sleeve_shape_J_2,Sleeve shape,3 +Puff,attr_Sleeve_shape_J_3,Sleeve shape,3 +Bell,attr_Sleeve_shape_J_4,Sleeve shape,3 +Batwing,attr_Sleeve_shape_J_5,Sleeve shape,3 +Shirt,attr_Sleeve_shape_J_6,Sleeve shape,3 +Rib,attr_Sleeve_shape_J_7,Sleeve shape,3 +Raglan,attr_Sleeve_shape_J_8,Sleeve shape,3 diff --git a/app/service/attribute_recognition/discriptor/jumpsuit/4_jumpsuit_Sleeve_shoulder.csv b/app/service/attribute_recognition/discriptor/jumpsuit/4_jumpsuit_Sleeve_shoulder.csv index 47e067a..4f98a9f 100644 --- a/app/service/attribute_recognition/discriptor/jumpsuit/4_jumpsuit_Sleeve_shoulder.csv +++ b/app/service/attribute_recognition/discriptor/jumpsuit/4_jumpsuit_Sleeve_shoulder.csv @@ -1,5 +1,5 @@ labelName,join_attr,taskName,taskId -Regular,attr_Sleeve_shoulder_J_1,Sleeve_Shoulder,4 -Cold,attr_Sleeve_shoulder_J_2,Sleeve_Shoulder,4 -Tucked,attr_Sleeve_shoulder_J_3,Sleeve_Shoulder,4 -Balmain,attr_Sleeve_shoulder_J_4,Sleeve_Shoulder,4 +Regular,attr_Sleeve_shoulder_J_1,Sleeve shoulder,4 +Cold,attr_Sleeve_shoulder_J_2,Sleeve shoulder,4 +Tucked,attr_Sleeve_shoulder_J_3,Sleeve shoulder,4 +Balmain,attr_Sleeve_shoulder_J_4,Sleeve shoulder,4 diff --git a/app/service/attribute_recognition/discriptor/outwear/11_outer_opening.csv b/app/service/attribute_recognition/discriptor/outwear/11_outer_opening.csv index d8c5372..53d0d42 100644 --- a/app/service/attribute_recognition/discriptor/outwear/11_outer_opening.csv +++ b/app/service/attribute_recognition/discriptor/outwear/11_outer_opening.csv @@ -1,3 +1,3 @@ labelName,join_attr,taskName,taskId -Full,attr_Opening_O_1,Opening_Type,11 -Half,attr_Opening_O_2,Opening_Type,11 +Full,attr_Opening_O_1,Opening,11 +Half,attr_Opening_O_2,Opening,11 diff --git a/app/service/attribute_recognition/discriptor/outwear/12_outer_OPType.csv b/app/service/attribute_recognition/discriptor/outwear/12_outer_OPType.csv index 3e4ee2c..8750eb1 100644 --- a/app/service/attribute_recognition/discriptor/outwear/12_outer_OPType.csv +++ b/app/service/attribute_recognition/discriptor/outwear/12_outer_OPType.csv @@ -1,5 +1,5 @@ labelName,join_attr,taskName,taskId -Button,attr_OPType_O_1,Opening_Type,12 -Zipper,attr_OPType_O_2,Opening_Type,12 -Thread,attr_OPType_O_3,Opening_Type,12 -Hook,attr_OPType_O_4,Opening_Type,12 +Button,attr_OPType_O_1,Opening type,12 +Zipper,attr_OPType_O_2,Opening type,12 +Thread,attr_OPType_O_3,Opening type,12 +Hook,attr_OPType_O_4,Opening type,12 diff --git a/app/service/attribute_recognition/discriptor/outwear/2_outer_type.csv b/app/service/attribute_recognition/discriptor/outwear/2_outer_type.csv index 60b6ae5..8542302 100644 --- a/app/service/attribute_recognition/discriptor/outwear/2_outer_type.csv +++ b/app/service/attribute_recognition/discriptor/outwear/2_outer_type.csv @@ -15,4 +15,4 @@ Biker jacket,attr_Outer_type_13,Type,2 Pea coat,attr_Outer_type_14,Type,2 Shacket,attr_Outer_type_15,Type,2 Denim jacket,attr_Outer_type_16,Type,2 -Raincoat,attr_Outer_type_17,Type,2 +Raincoat,attr_Outer_type_17,Type,2 \ No newline at end of file diff --git a/app/service/attribute_recognition/discriptor/outwear/3_outer_sleeve_length.csv b/app/service/attribute_recognition/discriptor/outwear/3_outer_sleeve_length.csv index 8e35b85..eaed7aa 100644 --- a/app/service/attribute_recognition/discriptor/outwear/3_outer_sleeve_length.csv +++ b/app/service/attribute_recognition/discriptor/outwear/3_outer_sleeve_length.csv @@ -1,6 +1,6 @@ labelName,join_attr,taskName,taskId -Sleeveless,attr_sleeve_length_1,Sleeve_Length,3 -Short,attr_sleeve_length_2,Sleeve_Length,3 -Middle,attr_sleeve_length_3,Sleeve_Length,3 -Seven,attr_sleeve_length_4,Sleeve_Length,3 -Long,attr_sleeve_length_5,Sleeve_Length,3 +Sleeveless,attr_sleeve_length_1,Sleeve length,3 +Short,attr_sleeve_length_2,Sleeve length,3 +Middle,attr_sleeve_length_3,Sleeve length,3 +Seven,attr_sleeve_length_4,Sleeve length,3 +Long,attr_sleeve_length_5,Sleeve length,3 diff --git a/app/service/attribute_recognition/discriptor/outwear/4_outer_sleeve_shape.csv b/app/service/attribute_recognition/discriptor/outwear/4_outer_sleeve_shape.csv index 4e8f770..cfaf579 100644 --- a/app/service/attribute_recognition/discriptor/outwear/4_outer_sleeve_shape.csv +++ b/app/service/attribute_recognition/discriptor/outwear/4_outer_sleeve_shape.csv @@ -1,9 +1,9 @@ labelName,join_attr,taskName,taskId -Regular,attr_sleeve_shape_O_1,Sleeve_Shape,4 -Slim,attr_sleeve_shape_O_2,Sleeve_Shape,4 -Puff,attr_sleeve_shape_O_3,Sleeve_Shape,4 -Bell,attr_sleeve_shape_O_4,Sleeve_Shape,4 -Batwing,attr_sleeve_shape_O_5,Sleeve_Shape,4 -Shirt,attr_sleeve_shape_O_6,Sleeve_Shape,4 -Rib,attr_sleeve_shape_O_7,Sleeve_Shape,4 -Raglan,attr_sleeve_shape_O_8,Sleeve_Shape,4 +Regular,attr_sleeve_shape_O_1,Sleeve shape,4 +Slim,attr_sleeve_shape_O_2,Sleeve shape,4 +Puff,attr_sleeve_shape_O_3,Sleeve shape,4 +Bell,attr_sleeve_shape_O_4,Sleeve shape,4 +Batwing,attr_sleeve_shape_O_5,Sleeve shape,4 +Shirt,attr_sleeve_shape_O_6,Sleeve shape,4 +Rib,attr_sleeve_shape_O_7,Sleeve shape,4 +Raglan,attr_sleeve_shape_O_8,Sleeve shape,4 diff --git a/app/service/attribute_recognition/discriptor/outwear/5_outer_sleeve_shoulder.csv b/app/service/attribute_recognition/discriptor/outwear/5_outer_sleeve_shoulder.csv index 3e421d0..512d9de 100644 --- a/app/service/attribute_recognition/discriptor/outwear/5_outer_sleeve_shoulder.csv +++ b/app/service/attribute_recognition/discriptor/outwear/5_outer_sleeve_shoulder.csv @@ -1,6 +1,6 @@ labelName,join_attr,taskName,taskId -Regular,attr_sleeve_shoulder_O_1,Sleeve_Shoulder,5 -Cold,attr_sleeve_shoulder_O_2,Sleeve_Shoulder,5 -Tucked,attr_sleeve_shoulder_O_3,Sleeve_Shoulder,5 -Balmain,attr_sleeve_shoulder_O_4,Sleeve_Shoulder,5 -Drop Shoulder,attr_sleeve_shoulder_O_5,Sleeve_Shoulder,5 +Regular,attr_sleeve_shoulder_O_1,Sleeve shoulder,5 +Cold,attr_sleeve_shoulder_O_2,Sleeve shoulder,5 +Tucked,attr_sleeve_shoulder_O_3,Sleeve shoulder,5 +Balmain,attr_sleeve_shoulder_O_4,Sleeve shoulder,5 +Drop Shoulder,attr_sleeve_shoulder_O_5,Sleeve shoulder,5 diff --git a/app/service/attribute_recognition/discriptor/top/11_top_OPType.csv b/app/service/attribute_recognition/discriptor/top/11_top_OPType.csv index 870631b..34a3934 100644 --- a/app/service/attribute_recognition/discriptor/top/11_top_OPType.csv +++ b/app/service/attribute_recognition/discriptor/top/11_top_OPType.csv @@ -1,5 +1,5 @@ labelName,join_attr,taskName,taskId -Button,attr_OPType_U_1,Opening_Type,11 -Zipper,attr_OPType_U_2,Opening_Type,11 -Thread,attr_OPType_U_3,Opening_Type,11 -Hook,attr_OPType_U_4,Opening_Type,11 +Button,attr_OPType_U_1,Opening type,11 +Zipper,attr_OPType_U_2,Opening type,11 +Thread,attr_OPType_U_3,Opening type,11 +Hook,attr_OPType_U_4,Opening type,11 diff --git a/app/service/attribute_recognition/discriptor/top/3_top_Sleeve_length.csv b/app/service/attribute_recognition/discriptor/top/3_top_Sleeve_length.csv index 1f2a0f3..cb9e969 100644 --- a/app/service/attribute_recognition/discriptor/top/3_top_Sleeve_length.csv +++ b/app/service/attribute_recognition/discriptor/top/3_top_Sleeve_length.csv @@ -1,6 +1,6 @@ labelName,join_attr,taskName,taskId -Sleeveless,attr_Sleeve_length_1,Sleeve_Length,3 -Short,attr_Sleeve_length_2,Sleeve_Length,3 -Middle,attr_Sleeve_length_3,Sleeve_Length,3 -Seven,attr_Sleeve_length_4,Sleeve_Length,3 -Long,attr_Sleeve_length_5,Sleeve_Length,3 +Sleeveless,attr_Sleeve_length_1,Sleeve length,3 +Short,attr_Sleeve_length_2,Sleeve length,3 +Middle,attr_Sleeve_length_3,Sleeve length,3 +Seven,attr_Sleeve_length_4,Sleeve length,3 +Long,attr_Sleeve_length_5,Sleeve length,3 diff --git a/app/service/attribute_recognition/discriptor/top/4_top_Sleeve_shape.csv b/app/service/attribute_recognition/discriptor/top/4_top_Sleeve_shape.csv index d429c11..2c53b12 100644 --- a/app/service/attribute_recognition/discriptor/top/4_top_Sleeve_shape.csv +++ b/app/service/attribute_recognition/discriptor/top/4_top_Sleeve_shape.csv @@ -1,9 +1,9 @@ labelName,join_attr,taskName,taskId -Regular,attr_Sleeve_shape_1,Sleeve_Shape,4 -Slim,attr_Sleeve_shape_2,Sleeve_Shape,4 -Puff,attr_Sleeve_shape_3,Sleeve_Shape,4 -Bell,attr_Sleeve_shape_4,Sleeve_Shape,4 -Batwing,attr_Sleeve_shape_5,Sleeve_Shape,4 -Shirt,attr_Sleeve_shape_6,Sleeve_Shape,4 -Rib,attr_Sleeve_shape_7,Sleeve_Shape,4 -Raglan,attr_Sleeve_shape_8,Sleeve_Shape,4 +Regular,attr_Sleeve_shape_1,Sleeve shape,4 +Slim,attr_Sleeve_shape_2,Sleeve shape,4 +Puff,attr_Sleeve_shape_3,Sleeve shape,4 +Bell,attr_Sleeve_shape_4,Sleeve shape,4 +Batwing,attr_Sleeve_shape_5,Sleeve shape,4 +Shirt,attr_Sleeve_shape_6,Sleeve shape,4 +Rib,attr_Sleeve_shape_7,Sleeve shape,4 +Raglan,attr_Sleeve_shape_8,Sleeve shape,4 diff --git a/app/service/attribute_recognition/discriptor/top/5_top_Sleeve_shoulder.csv b/app/service/attribute_recognition/discriptor/top/5_top_Sleeve_shoulder.csv index c31e7ea..7997bd5 100644 --- a/app/service/attribute_recognition/discriptor/top/5_top_Sleeve_shoulder.csv +++ b/app/service/attribute_recognition/discriptor/top/5_top_Sleeve_shoulder.csv @@ -1,5 +1,5 @@ labelName,join_attr,taskName,taskId -Regular,attr_Sleeve_shoulder_1,Sleeve_Shoulder,5 -Cold,attr_Sleeve_shoulder_2,Sleeve_Shoulder,5 -Tucked,attr_Sleeve_shoulder_3,Sleeve_Shoulder,5 -Balmain,attr_Sleeve_shoulder_4,Sleeve_Shoulder,5 +Regular,attr_Sleeve_shoulder_1,Sleeve shoulder,5 +Cold,attr_Sleeve_shoulder_2,Sleeve shoulder,5 +Tucked,attr_Sleeve_shoulder_3,Sleeve shoulder,5 +Balmain,attr_Sleeve_shoulder_4,Sleeve shoulder,5 diff --git a/app/service/attribute_recognition/discriptor/top/ori12_top_OPType.csv b/app/service/attribute_recognition/discriptor/top/ori12_top_OPType.csv index 98e65c6..6bda0ed 100644 --- a/app/service/attribute_recognition/discriptor/top/ori12_top_OPType.csv +++ b/app/service/attribute_recognition/discriptor/top/ori12_top_OPType.csv @@ -1,5 +1,5 @@ labelName,join_attr,taskName,taskId -Button,attr_OPType_U_1,Opening_Type,12 -Zipper,attr_OPType_U_2,Opening_Type,12 -Thread,attr_OPType_U_3,Opening_Type,12 -Hook,attr_OPType_U_4,Opening_Type,12 +Button,attr_OPType_U_1,Opening type,12 +Zipper,attr_OPType_U_2,Opening type,12 +Thread,attr_OPType_U_3,Opening type,12 +Hook,attr_OPType_U_4,Opening type,12 diff --git a/app/service/attribute_recognition/discriptor/top/ori3_top_Sleeve_length.csv b/app/service/attribute_recognition/discriptor/top/ori3_top_Sleeve_length.csv index 3549164..b76a721 100644 --- a/app/service/attribute_recognition/discriptor/top/ori3_top_Sleeve_length.csv +++ b/app/service/attribute_recognition/discriptor/top/ori3_top_Sleeve_length.csv @@ -1,6 +1,6 @@ labelName,join_attr,taskName,taskId -Sleeveless,attr_Sleeve_length_U_1,Sleeve_Length,3 -Short,attr_Sleeve_length_U_2,Sleeve_Length,3 -Middle,attr_Sleeve_length_U_3,Sleeve_Length,3 -Seven,attr_Sleeve_length_U_4,Sleeve_Length,3 -Long,attr_Sleeve_length_U_5,Sleeve_Length,3 +Sleeveless,attr_Sleeve_length_U_1,Sleeve length,3 +Short,attr_Sleeve_length_U_2,Sleeve length,3 +Middle,attr_Sleeve_length_U_3,Sleeve length,3 +Seven,attr_Sleeve_length_U_4,Sleeve length,3 +Long,attr_Sleeve_length_U_5,Sleeve length,3 diff --git a/app/service/attribute_recognition/discriptor/top/ori4_top_Sleeve_shape.csv b/app/service/attribute_recognition/discriptor/top/ori4_top_Sleeve_shape.csv index 15517c5..1f75415 100644 --- a/app/service/attribute_recognition/discriptor/top/ori4_top_Sleeve_shape.csv +++ b/app/service/attribute_recognition/discriptor/top/ori4_top_Sleeve_shape.csv @@ -1,9 +1,9 @@ labelName,join_attr,taskName,taskId -Regular,attr_Sleeve_shape_U_1,Sleeve_Shape,4 -Slim,attr_Sleeve_shape_U_2,Sleeve_Shape,4 -Puff,attr_Sleeve_shape_U_3,Sleeve_Shape,4 -Bell,attr_Sleeve_shape_U_4,Sleeve_Shape,4 -Batwing,attr_Sleeve_shape_U_5,Sleeve_Shape,4 -Shirt,attr_Sleeve_shape_U_6,Sleeve_Shape,4 -Rib,attr_Sleeve_shape_U_7,Sleeve_Shape,4 -Raglan,attr_Sleeve_shape_U_8,Sleeve_Shape,4 +Regular,attr_Sleeve_shape_U_1,Sleeve shape,4 +Slim,attr_Sleeve_shape_U_2,Sleeve shape,4 +Puff,attr_Sleeve_shape_U_3,Sleeve shape,4 +Bell,attr_Sleeve_shape_U_4,Sleeve shape,4 +Batwing,attr_Sleeve_shape_U_5,Sleeve shape,4 +Shirt,attr_Sleeve_shape_U_6,Sleeve shape,4 +Rib,attr_Sleeve_shape_U_7,Sleeve shape,4 +Raglan,attr_Sleeve_shape_U_8,Sleeve shape,4 diff --git a/app/service/attribute_recognition/discriptor/top/ori5_top_Sleeve_shoulder.csv b/app/service/attribute_recognition/discriptor/top/ori5_top_Sleeve_shoulder.csv index 9a051a1..97b8bcd 100644 --- a/app/service/attribute_recognition/discriptor/top/ori5_top_Sleeve_shoulder.csv +++ b/app/service/attribute_recognition/discriptor/top/ori5_top_Sleeve_shoulder.csv @@ -1,5 +1,5 @@ labelName,join_attr,taskName,taskId -Regular,attr_Sleeve_shoulder_U_1,Sleeve_Shoulder,5 -Cold,attr_Sleeve_shoulder_U_2,Sleeve_Shoulder,5 -Tucked,attr_Sleeve_shoulder_U_3,Sleeve_Shoulder,5 -Balmain,attr_Sleeve_shoulder_U_4,Sleeve_Shoulder,5 +Regular,attr_Sleeve_shoulder_U_1,Sleeve shoulder,5 +Cold,attr_Sleeve_shoulder_U_2,Sleeve shoulder,5 +Tucked,attr_Sleeve_shoulder_U_3,Sleeve shoulder,5 +Balmain,attr_Sleeve_shoulder_U_4,Sleeve shoulder,5 diff --git a/app/service/attribute_recognition/service.py b/app/service/attribute_recognition/service.py index 5ca5927..df6e295 100644 --- a/app/service/attribute_recognition/service.py +++ b/app/service/attribute_recognition/service.py @@ -111,7 +111,7 @@ class AttributeRecognition: attr_dict = {} category = 'bottom' attr_dict['Item'] = category - attr_dict['BTM_Type'] = ['Pants'] + attr_dict['Type'] = ['Pants'] for i in range(len(args.bottom_discription_list)): attr_description = args.bottom_discription_list[i] attr_model_path = args.bottom_model_list[i] @@ -119,7 +119,7 @@ class AttributeRecognition: attr_dict = Merge(attr_dict, present_dict) elif category == 'skirt': - attr_dict = {'BTM_Type': ['Skirt']} + attr_dict = {'Type': ['Skirt']} category = 'bottom' attr_dict['Item'] = category for i in range(len(args.bottom_discription_list)): diff --git a/app/service/outfit_matcher/outfit_evaluator.py b/app/service/outfit_matcher/outfit_evaluator.py index 2f74bb0..a35155e 100644 --- a/app/service/outfit_matcher/outfit_evaluator.py +++ b/app/service/outfit_matcher/outfit_evaluator.py @@ -21,6 +21,7 @@ class Backbone(object): access_key=MINIO_ACCESS, secret_key=MINIO_SECRET, secure=MINIO_SECURE) + @RunTime # TODO 用多线程读图片 def load_image(self, img_path): @@ -38,6 +39,7 @@ class Backbone(object): except Exception as e: print(f"An error occurred: {e}") return None + @staticmethod def resize_image(img): """ @@ -195,43 +197,45 @@ class OutfitMatcher(object): outfits = [outfits[i] for i in sorted_indices] # 最好或最差的五个 scores = scores[sorted_indices] # 这五个的分数 - # 设置子图的行列数 - num_rows = len(outfits) - num_cols = max([len(x) for x in outfits]) + 1 # 一个是图片,一个是分数 + return outfits, scores.tolist() - # 创建一个新的图像,并指定子图的行列数 - fig, axes = plt.subplots(num_rows, num_cols, figsize=(8, 15)) - - title = f"Best {topk} Outfits" if best else f"Worst {topk} Outfits" - fig.suptitle(title, fontsize=16) - - # 遍历每套outfit并将其显示在对应的子图中 - for i, (outfit, score) in enumerate(zip(outfits, scores)): - # 显示分数 - axes[i, 0].text(0.1, 0.5, f"Score: {score:.4f}", fontsize=12) - axes[i, 0].axis("off") - # 显示图片 - for j, item in enumerate(outfit): - img = self.load_image(item['image_path']) # 读取图片 - axes[i, j + 1].imshow(img) # 在对应的子图中显示图片 - axes[i, j + 1].axis('off') # 关闭坐标轴 - axes[i, j + 1].set_title(item["semantic_category"], fontsize=10) - for j in range(len(outfit), num_cols): - axes[i, j].axis("off") - - # 在每一行的底部添加一条横线 - axes[i, 0].axhline(y=0, color='black', linewidth=1) - # 隐藏最后一行的横线 - axes[-1, 0].axhline(y=0, color='white', linewidth=1) - - # 调整布局 - plt.subplots_adjust(wspace=0.1, hspace=0.1) - plt.tight_layout() - - if output_path: - plt.savefig(output_path) - else: - plt.show() + # # 设置子图的行列数 + # num_rows = len(outfits) + # num_cols = max([len(x) for x in outfits]) + 1 # 一个是图片,一个是分数 + # + # # 创建一个新的图像,并指定子图的行列数 + # fig, axes = plt.subplots(num_rows, num_cols, figsize=(8, 15)) + # + # title = f"Best {topk} Outfits" if best else f"Worst {topk} Outfits" + # fig.suptitle(title, fontsize=16) + # + # # 遍历每套outfit并将其显示在对应的子图中 + # for i, (outfit, score) in enumerate(zip(outfits, scores)): + # # 显示分数 + # axes[i, 0].text(0.1, 0.5, f"Score: {score:.4f}", fontsize=12) + # axes[i, 0].axis("off") + # # 显示图片 + # for j, item in enumerate(outfit): + # img = self.load_image(item['image_path']) # 读取图片 + # axes[i, j + 1].imshow(img) # 在对应的子图中显示图片 + # axes[i, j + 1].axis('off') # 关闭坐标轴 + # axes[i, j + 1].set_title(item["semantic_category"], fontsize=10) + # for j in range(len(outfit), num_cols): + # axes[i, j].axis("off") + # + # # 在每一行的底部添加一条横线 + # axes[i, 0].axhline(y=0, color='black', linewidth=1) + # # 隐藏最后一行的横线 + # axes[-1, 0].axhline(y=0, color='white', linewidth=1) + # + # # 调整布局 + # plt.subplots_adjust(wspace=0.1, hspace=0.1) + # plt.tight_layout() + # + # if output_path: + # plt.savefig(output_path) + # else: + # plt.show() class OutfitMatcherHon(OutfitMatcher): diff --git a/app/service/outfit_matcher/service.py b/app/service/outfit_matcher/service.py index 41d9f59..b99af95 100644 --- a/app/service/outfit_matcher/service.py +++ b/app/service/outfit_matcher/service.py @@ -49,11 +49,9 @@ if __name__ == '__main__': best_outfits = [outfits[i] for i in sorted_indices] # 最好的五个 # 结果可视化 - service.visualize(outfits, scores, param["topk"], best=True, - output_path=os.path.join(r"D:\PhD_Study\MIXI\mitu\image\123", - f"{item['item_name']}_best_{param['topk']}.png")) - service.visualize(outfits, scores, param["topk"], best=False, - output_path=os.path.join(r"D:\PhD_Study\MIXI\mitu\image\123", - f"{item['item_name']}_worst_{param['topk']}.png")) - - + # service.visualize(outfits, scores, param["topk"], best=True, + # output_path=os.path.join(r"D:\PhD_Study\MIXI\mitu\image\123", + # f"{item['item_name']}_best_{param['topk']}.png")) + # service.visualize(outfits, scores, param["topk"], best=False, + # output_path=os.path.join(r"D:\PhD_Study\MIXI\mitu\image\123", + # f"{item['item_name']}_worst_{param['topk']}.png")) diff --git a/docker-compose.yml b/docker-compose.yml index b3dfd4d..f659040 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,8 @@ version: "3" services: trinity_mixi: - image: "trinity_client_mixi:latest" container_name: trinity_mixi + build: . volumes: - ./trinity_client_mixi:/trinity ports: