clementBE commited on
Commit
770194d
·
verified ·
1 Parent(s): e582c25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -78,7 +78,7 @@ def closest_basic_color(rgb):
78
  return closest_color
79
 
80
  def get_dominant_color(image, num_colors=5):
81
- image = image.resize((100, 100))
82
  pixels = np.array(image).reshape(-1, 3)
83
  kmeans = MiniBatchKMeans(n_clusters=num_colors, random_state=0, n_init=5)
84
  kmeans.fit(pixels)
@@ -111,7 +111,7 @@ def classify_zip_and_analyze_color(zip_file):
111
 
112
  # Thumbnail for gallery
113
  thumb = image.copy()
114
- thumb.thumbnail((100, 100))
115
  thumbnails.append(thumb)
116
 
117
  # Classification
 
78
  return closest_color
79
 
80
  def get_dominant_color(image, num_colors=5):
81
+ image = image.resize((300, 300))
82
  pixels = np.array(image).reshape(-1, 3)
83
  kmeans = MiniBatchKMeans(n_clusters=num_colors, random_state=0, n_init=5)
84
  kmeans.fit(pixels)
 
111
 
112
  # Thumbnail for gallery
113
  thumb = image.copy()
114
+ thumb.thumbnail((300, 300))
115
  thumbnails.append(thumb)
116
 
117
  # Classification