Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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((
|
| 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((
|
| 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
|