Ovyerus / deeppyer

Image deepfryer written in Python.
MIT License
43 stars 5 forks source link

Deeppyer module example not working #1

Closed TylerRajotte closed 7 years ago

TylerRajotte commented 7 years ago

When I run the module example:

from PIL import Image
import deeppyer, asyncio

async def main():
    img = Image.open('./foo.jpg')
    img = await deeppyer.deepfry(img, token='Idohaveatokenhere')
    img.save('./bar.jpg')

loop = asynio.get_event_loop()
loop.run_until_complete(main())

It errors out due to loop = asynio.get_event_loop() But even after fixing the variable it still errors and I get the following

Traceback (most recent call last): File "Z:/PyCharm/Discord/Deeppyer test.py", line 10, in loop.run_until_complete(main()) File "C:\Users\Tyler\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 467, in run_until_complete return future.result() File "Z:/PyCharm/Discord/Deeppyer test.py", line 6, in main img = await deeppyer.deepfry(img, token='optional token') File "Z:\PyCharm\Discord\deeppyer.py", line 42, in deepfry raise Exception('No face detected. Note that only real pictures of faces should work.') Exception: No face detected. Note that only real pictures of faces should work.

Ovyerus commented 7 years ago

Thanks for catching that typo for me.

Does the image you are trying to deepfry have a real face in it? If it does, then it could be looking too far to one side, or the API just can't detect it for some reason.

TylerRajotte commented 7 years ago

The Image I was using was butterbot and when I use the test image of foo it does work so the error seems to occur when there is no face to detect and when it does receive a real face it works as intended

Ovyerus commented 7 years ago

Yeah that's an error the program is made to throw. If you want I can edit it so that if it cannot find a face, it'll fail silently and continue on with the rest of the effects.

TylerRajotte commented 7 years ago

That would seem better that have the whole thing fall apart, Thank You

Ovyerus commented 7 years ago

82d306002b045f7180c0525758ea466fabe1bf07 removes the exception and just continues on with the rest of the effects.