algolia / color-extractor

Extract the dominant color(s) of your fashion articles!
https://algolia.com
Other
279 stars 69 forks source link

Error in image_to_color.py while using as library: Line 36 #9

Open newpokemon opened 6 years ago

newpokemon commented 6 years ago

Hey Thanks for the fabulous work!

I tried and CLI is working perfectly fine. However, when tried as library in a python file, giving this error:

Traceback (most recent call last): File "test.py", line 10, in print(img_to_color.get(img)) File "/home/color-extractor-master/color_extractor/image_to_color.py", line 36, in get if self._settings['debug'] is None: KeyError: 'debug'

Non CS background so might overlook something, please help! Thanks in advance.

shahidammer commented 6 years ago

@newpokemon did you get to solve the issue? Stuck with the same thing

gauthamk28 commented 6 years ago

I am also getting the same error , someone please help to fix this error Thanks in advance

aliabdullah176 commented 6 years ago

Same error, any idea whats going wrong?

emilybelnavis commented 5 years ago

try passing the debug setting as a dictionary

to get all the info:

settings = {'debug': {}}

image_to_color = ImageToColor(npz['samples'], npz['labels'], settings)

to get just the color name:

settings = { 'debug': None }

image_to_color = ImageToColor(npz['samples'], npz['labels'], settings)
youngseungjeon commented 5 years ago

I' have also same issuse. so, I've tried CLI on jupyter noteobok as below.

import os
import pandas as pd

files= os.listdir("./imgs")

img_name= []
colors= []

for i in files:
    order= "./color-extractor color_names.npz ./imgs/"+i
    result= !{order}

    img_name.append(i)
    colors.append(result)

df= pd.DataFrame({"img_name":img_name, "colors": colors})
Anishauday commented 3 years ago

Screenshot 2021-01-22 125421 I'm getting the above error. Can anyone help how extract the color details?