gojiteji commited on
Commit
22e7fa9
·
verified ·
1 Parent(s): ebbff36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -42,7 +42,6 @@ def generate(logo, Vtubername):
42
 
43
  return colors
44
 
45
- # 使用例
46
  dominant_colors = extract_dominant_colors(logo, num_colors=3)
47
  template_prime_colors = {
48
  "black color": [0, 0, 0],
@@ -67,7 +66,7 @@ def generate(logo, Vtubername):
67
  "brown": [139,69,19],
68
  }
69
  _primary_color = dominant_colors[0]
70
- # get closest color name
71
  closest_color = "black color"
72
  for color in template_prime_colors:
73
  if np.linalg.norm(np.array(template_prime_colors[color]) - _primary_color) < np.linalg.norm(np.array(template_prime_colors[closest_color]) - _primary_color):
@@ -76,7 +75,7 @@ def generate(logo, Vtubername):
76
  print(primary_color)
77
  secondary_color=str("rgb("+str(dominant_colors[1][0])+", "+str(dominant_colors[1][1])+", "+str(dominant_colors[1][2])+")")
78
  third_color=str("rgb("+str(dominant_colors[2][0])+", "+str(dominant_colors[2][1])+", "+str(dominant_colors[2][2])+")")
79
- exit()
80
  import requests
81
  import os
82
  sdkey = os.environ["sdkey"]
 
42
 
43
  return colors
44
 
 
45
  dominant_colors = extract_dominant_colors(logo, num_colors=3)
46
  template_prime_colors = {
47
  "black color": [0, 0, 0],
 
66
  "brown": [139,69,19],
67
  }
68
  _primary_color = dominant_colors[0]
69
+
70
  closest_color = "black color"
71
  for color in template_prime_colors:
72
  if np.linalg.norm(np.array(template_prime_colors[color]) - _primary_color) < np.linalg.norm(np.array(template_prime_colors[closest_color]) - _primary_color):
 
75
  print(primary_color)
76
  secondary_color=str("rgb("+str(dominant_colors[1][0])+", "+str(dominant_colors[1][1])+", "+str(dominant_colors[1][2])+")")
77
  third_color=str("rgb("+str(dominant_colors[2][0])+", "+str(dominant_colors[2][1])+", "+str(dominant_colors[2][2])+")")
78
+
79
  import requests
80
  import os
81
  sdkey = os.environ["sdkey"]