vaniv commited on
Commit
427bd4c
·
verified ·
1 Parent(s): 17a52f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -13
app.py CHANGED
@@ -10,8 +10,7 @@ import colorsys
10
  learn = load_learner('fashion_mnist_resnet18.pkl')
11
 
12
  # Define class names
13
- class_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat',
14
- 'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot']
15
 
16
  # Helper function to get the name of the closest color
17
  def closest_color(requested_color):
@@ -41,18 +40,12 @@ def get_complementary_color(rgb_color):
41
  return closest_color((r, g, b))
42
 
43
  def get_outfit_recommendation(pred_class):
44
- if pred_class in ['T-shirt/top', 'Pullover', 'Shirt']:
45
- return 'Trousers'
46
- elif pred_class == 'Trouser':
47
- return 'Top'
48
- elif pred_class in ['Dress', 'Coat']:
49
- return 'Shoes'
50
- elif pred_class in ['Sandal', 'Sneaker', 'Ankle boot']:
51
- return 'Trousers'
52
- elif pred_class == 'Bag':
53
- return 'Top'
54
  else:
55
- return 'Item'
56
 
57
  def predict(image):
58
  pred_class, pred_idx, outputs = learn.predict(image)
 
10
  learn = load_learner('fashion_mnist_resnet18.pkl')
11
 
12
  # Define class names
13
+ class_names = ['jeans', 'top']
 
14
 
15
  # Helper function to get the name of the closest color
16
  def closest_color(requested_color):
 
40
  return closest_color((r, g, b))
41
 
42
  def get_outfit_recommendation(pred_class):
43
+ if pred_class in ['jeans']:
44
+ return 'top'
45
+ elif pred_class in ['top']:
46
+ return 'top'
 
 
 
 
 
 
47
  else:
48
+ return 'item'
49
 
50
  def predict(image):
51
  pred_class, pred_idx, outputs = learn.predict(image)