user-agent commited on
Commit
64af198
1 Parent(s): 2abf116

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -32,7 +32,7 @@ def get_colour(image_urls, category):
32
  for i in range(len(colourLabels)):
33
  colourLabels[i] = colourLabels[i] + " clothing: " + category
34
 
35
- responses = pipe(image_urls, candidate_labels=colourLabels, device=device)
36
  # Get the most common colour
37
  mainColour = responses[0][0]['label'].split(" clothing:")[0]
38
 
@@ -46,7 +46,7 @@ def get_colour(image_urls, category):
46
  labels[i] = labels[i] + " clothing: " + category
47
 
48
  # Run pipeline in one go
49
- responses = pipe(image_urls, candidate_labels=labels, device=device)
50
  subColour = responses[0][0]['label'].split(" clothing:")[0]
51
 
52
  return subColour, mainColour, responses[0][0]['score']
 
32
  for i in range(len(colourLabels)):
33
  colourLabels[i] = colourLabels[i] + " clothing: " + category
34
 
35
+ responses = pipe(image_urls, candidate_labels=colourLabels)
36
  # Get the most common colour
37
  mainColour = responses[0][0]['label'].split(" clothing:")[0]
38
 
 
46
  labels[i] = labels[i] + " clothing: " + category
47
 
48
  # Run pipeline in one go
49
+ responses = pipe(image_urls, candidate_labels=labels)
50
  subColour = responses[0][0]['label'].split(" clothing:")[0]
51
 
52
  return subColour, mainColour, responses[0][0]['score']