ZumoLabs / zpy

Synthetic data for computer vision. An open source toolkit using Blender and Python.
GNU General Public License v3.0
302 stars 35 forks source link

zpy.output_zumo.ZUMOParseError: width and height h:0 w:0 must be > 0 #33

Closed VictorAtPL closed 3 years ago

VictorAtPL commented 3 years ago

Describe the bug In Blender v2.91 and zpy v0.9.10 I got following error when I run Suzanne 3 demo run.py:

2021-03-18 20:49:05,507: INFO output.py] Outputting annotation file to /tmp/output/ZUMO_META.json
2021-03-18 20:49:05,507: WARNING files.py] Could not find path at /tmp/output/ZUMO_META.json
2021-03-18 20:49:05,507: INFO files.py] Writing JSON to file /tmp/output/ZUMO_META.json
2021-03-18 20:49:05,508: INFO output_zumo.py] Parsing ZUMO annotations at /tmp/output/ZUMO_META.json...
2021-03-18 20:49:05,508: INFO files.py] Reading JSON file at /tmp/output/ZUMO_META.json
2021-03-18 20:49:05,509: INFO output_zumo.py] images:9 categories:1 annotations:3
2021-03-18 20:49:05,509: INFO output_zumo.py] Parsing images...
Traceback (most recent call last):
  File "/home/piotr/untitled.blend/run.py", line 164, in <module>
  File "/home/piotr/untitled.blend/run.py", line 149, in run
  File "/home/piotr/repos/zpy/zpy/output_zumo.py", line 54, in output_annotations
    annotation_file=annotation_path, data_dir=self.saver.output_dir)
  File "/home/piotr/Files/blender/bar/lib/python3.7/site-packages/gin/config.py", line 1078, in gin_wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "/home/piotr/Files/blender/bar/lib/python3.7/site-packages/gin/utils.py", line 49, in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)
  File "<string>", line 3, in raise_from
  File "/home/piotr/Files/blender/bar/lib/python3.7/site-packages/gin/config.py", line 1055, in gin_wrapper
    return fn(*new_args, **new_kwargs)
  File "/home/piotr/repos/zpy/zpy/output_zumo.py", line 141, in parse_zumo_annotations
    f'width and height h:{height} w:{width} must be > 0')
zpy.output_zumo.ZUMOParseError: width and height h:0 w:0 must be > 0
  In call to configurable 'parse_zumo_annotations' (<function parse_zumo_annotations at 0x7f8c57a274d0>)

All data is generated, so it looks like a minor bug.

Expected behavior No errors when any of demo is run on released zpy version.

hu-po commented 3 years ago

Default width and height for ImageSaver and VideoSaver have now been updated to no longer be zero: https://github.com/ZumoLabs/zpy/commit/8b49d624f7999f1d9910096074b17f08e3ed1707