amirgame197 commited on
Commit
d82698b
1 Parent(s): bedd188

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -14,13 +14,13 @@ from transparent_background import Remover
14
 
15
  @spaces.GPU()
16
  def doo(video, color, mode, progress=gr.Progress()):
17
- print(color)
18
- if color.startswith('#'):
19
- color = color.lstrip('#')
20
  rgb = tuple(int(color[i:i+2], 16) for i in (0, 2, 4))
21
  color = str(list(rgb))
22
- elif color.startswith('rgba'):
23
- rgba_match = re.match(r'rgba\((\d+), (\d+), (\d+), ([\d.]+)\)', color)
24
  if rgba_match:
25
  r, g, b, _ = rgba_match.groups()
26
  color = str([int(r), int(g), int(b)])
 
14
 
15
  @spaces.GPU()
16
  def doo(video, color, mode, progress=gr.Progress()):
17
+ print(str(color))
18
+ if str(color).startswith('#'):
19
+ str(color) = color.lstrip('#')
20
  rgb = tuple(int(color[i:i+2], 16) for i in (0, 2, 4))
21
  color = str(list(rgb))
22
+ elif str(color).startswith('rgba'):
23
+ rgba_match = re.match(r'rgba\((\d+), (\d+), (\d+), ([\d.]+)\)', str(color))
24
  if rgba_match:
25
  r, g, b, _ = rgba_match.groups()
26
  color = str([int(r), int(g), int(b)])