mralamdari commited on
Commit
da31889
·
verified ·
1 Parent(s): 07251b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -27
app.py CHANGED
@@ -11,36 +11,11 @@ sizes = [18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
11
 
12
  shoes_data = pd.read_excel('Book1.xlsx')
13
 
14
- # def show_shoes(types, genders, colors, shoelaces, sizes):
15
- # shoes_arr = []
16
- # selection = [types, genders, colors, shoelaces, sizes]
17
- # for i in range(len(shoes_data)):
18
- # Flag = True
19
- # shoe_code,shoe_name,_,shoe_sizes,shoe_colors,shoe_shoelaces,shoe_sexes,shoe_types = shoes_data.iloc[i].values
20
- # shoes = [shoe_types.split('-'), shoe_sexes.split('-'), shoe_colors.split('-'), shoe_shoelaces.split('-'), shoe_sizes.split('-')]
21
-
22
- # for select_details, shoe_details in zip(selection, shoes):
23
- # if not select_details:
24
- # continue
25
- # for shoe_d in select_details:
26
- # if shoe_d not in shoe_details:
27
- # Flag = False
28
- # break
29
-
30
- # if not Flag:
31
- # break
32
- # if Flag:
33
- # shoes_arr.append((f'./Img/{shoe_code}.jpg', f'Name: {shoe_name} ***** Code: {shoe_code} ***** Sizes: {shoe_sizes}'))
34
-
35
- # if len(shoes_arr)==0:
36
- # shoes_arr.append(('./Img/Empty.png', 'این کالا موجود نمی باشد'))
37
- # return shoes_arr
38
-
39
-
40
  def show_shoes(types, genders, colors, shoelaces, sizes):
41
  shoes_arr = []
42
  selection = [types, genders, colors, shoelaces, sizes]
43
  for i in range(len(shoes_data)):
 
44
  shoe_code,shoe_name,_,shoe_sizes,shoe_colors,shoe_shoelaces,shoe_sexes,shoe_types = shoes_data.iloc[i].values
45
  shoes = [shoe_types.split('-'), shoe_sexes.split('-'), shoe_colors.split('-'), shoe_shoelaces.split('-'), shoe_sizes.split('-')]
46
 
@@ -49,14 +24,39 @@ def show_shoes(types, genders, colors, shoelaces, sizes):
49
  continue
50
  for shoe_d in select_details:
51
  if shoe_d not in shoe_details:
52
- shoes_arr.append((f'./Img/{shoe_code}.jpg', f'Name: {shoe_name} ***** Code: {shoe_code} ***** Sizes: {shoe_sizes}'))
53
  break
54
 
 
 
 
 
55
 
56
  if len(shoes_arr)==0:
57
  shoes_arr.append(('./Img/Empty.png', 'این کالا موجود نمی باشد'))
58
  return shoes_arr
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  demo = gr.Interface(
61
  fn=show_shoes,
62
  inputs=[
 
11
 
12
  shoes_data = pd.read_excel('Book1.xlsx')
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  def show_shoes(types, genders, colors, shoelaces, sizes):
15
  shoes_arr = []
16
  selection = [types, genders, colors, shoelaces, sizes]
17
  for i in range(len(shoes_data)):
18
+ Flag = True
19
  shoe_code,shoe_name,_,shoe_sizes,shoe_colors,shoe_shoelaces,shoe_sexes,shoe_types = shoes_data.iloc[i].values
20
  shoes = [shoe_types.split('-'), shoe_sexes.split('-'), shoe_colors.split('-'), shoe_shoelaces.split('-'), shoe_sizes.split('-')]
21
 
 
24
  continue
25
  for shoe_d in select_details:
26
  if shoe_d not in shoe_details:
27
+ Flag = False
28
  break
29
 
30
+ if not Flag:
31
+ break
32
+ if Flag:
33
+ shoes_arr.append((f'./Img/{shoe_code}.jpg', f'Name: {shoe_name} ***** Code: {shoe_code} ***** Sizes: {shoe_sizes}'))
34
 
35
  if len(shoes_arr)==0:
36
  shoes_arr.append(('./Img/Empty.png', 'این کالا موجود نمی باشد'))
37
  return shoes_arr
38
 
39
+
40
+ # def show_shoes(types, genders, colors, shoelaces, sizes):
41
+ # shoes_arr = []
42
+ # selection = [types, genders, colors, shoelaces, sizes]
43
+ # for i in range(len(shoes_data)):
44
+ # shoe_code,shoe_name,_,shoe_sizes,shoe_colors,shoe_shoelaces,shoe_sexes,shoe_types = shoes_data.iloc[i].values
45
+ # shoes = [shoe_types.split('-'), shoe_sexes.split('-'), shoe_colors.split('-'), shoe_shoelaces.split('-'), shoe_sizes.split('-')]
46
+
47
+ # for select_details, shoe_details in zip(selection, shoes):
48
+ # if not select_details:
49
+ # continue
50
+ # for shoe_d in select_details:
51
+ # if shoe_d not in shoe_details:
52
+ # shoes_arr.append((f'./Img/{shoe_code}.jpg', f'Name: {shoe_name} ***** Code: {shoe_code} ***** Sizes: {shoe_sizes}'))
53
+ # break
54
+
55
+
56
+ # if len(shoes_arr)==0:
57
+ # shoes_arr.append(('./Img/Empty.png', 'این کالا موجود نمی باشد'))
58
+ # return shoes_arr
59
+
60
  demo = gr.Interface(
61
  fn=show_shoes,
62
  inputs=[