zc-huhu commited on
Commit
c540905
·
1 Parent(s): 48bf0b5
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -13,12 +13,11 @@ garm_list_path = [os.path.join(example_path, "garment", garm) for garm in garm_l
13
  person_list = os.listdir(os.path.join(example_path,"person"))
14
  person_list_path = [os.path.join(example_path, "person", person) for person in person_list]
15
 
16
- garm_img_category_mapping = {garm_file: os.path.basename(garm_file).split("_")[1].capitalize() for garm_file in garm_list_path}
17
 
18
 
19
  def update_category(selected_garm_file):
20
- selected_category = garm_img_category_mapping.get(selected_garm_file, None)
21
- print(selected_garm_file, selected_category)
22
  return gr.update(value=selected_category)
23
 
24
  def call_tryon_api(person_file, garm_file, category, model_type='SD_V1'):
 
13
  person_list = os.listdir(os.path.join(example_path,"person"))
14
  person_list_path = [os.path.join(example_path, "person", person) for person in person_list]
15
 
16
+ garm_img_category_mapping = {os.path.basename(garm_file): os.path.basename(garm_file).split("_")[1].capitalize() for garm_file in garm_list_path}
17
 
18
 
19
  def update_category(selected_garm_file):
20
+ selected_category = garm_img_category_mapping.get(os.path.basename(selected_garm_file), "Fullbody")
 
21
  return gr.update(value=selected_category)
22
 
23
  def call_tryon_api(person_file, garm_file, category, model_type='SD_V1'):