h2oai / wave-image-styling-playground

A interactive playground to style and edit images, generate art and have fun.
MIT License
13 stars 2 forks source link

Error when image without face is uploaded #14

Closed dilithjay closed 1 year ago

dilithjay commented 1 year ago
Unhandled exception
Traceback (most recent call last):
  File "/home/dilith/Projects/wave-image-styler/.venv/lib/python3.7/site-packages/h2o_wave/server.py", line 320, in _process
    await self._handle(q)
  File "./img_styler/ui/app.py", line 34, in serve
    await handle_on(q)
  File "./img_styler/ui/wave_next.py", line 72, in handle_on
    if await _match_predicate(predicate, func, arity, q, arg_value):
  File "./img_styler/ui/wave_next.py", line 22, in _match_predicate
    await _invoke_handler(func, arity, q, arg)
  File "/home/dilith/Projects/wave-image-styler/.venv/lib/python3.7/site-packages/h2o_wave/routing.py", line 117, in _invoke_handler
    await func(q)
  File "./img_styler/ui/handlers.py", line 213, in on_task_selection
    await process(q)
  File "./img_styler/ui/handlers.py", line 137, in process
    await image_upload(q)
  File "./img_styler/ui/handlers.py", line 268, in image_upload
    facial_feature_analysis(q, local_path, "Uploaded Image")
  File "./img_styler/ui/handlers.py", line 384, in facial_feature_analysis
    logger.info(f"Facial Attributes: {obj}")
UnboundLocalError: local variable 'obj' referenced before assignment
pramitchoudhary commented 1 year ago

So, as we extend the Studio, if we don't have any faces then maybe we just allow the image to be uploaded without any annotation?

pramitchoudhary commented 1 year ago

Done.