When importing a directory of COCO annotation files, the importer returns a List[List[AnnotationFile]] type. This causes darwin-py to try flattening the list. If there are any NoneTypes in parsed_files at this point, a TypeError will be thrown: 'NoneType' object is not iterable.
Solution
These NoneTypes in parsed_files come from files that the importer was unable to parse. Therefore, remove all NoneTypes from parsed_files prior. Note that we can't simply filter for .json files, since some annotation files are in the .xml format
Changelog
Fixed rare bug when importing directories of COCO annotations
Problem
When importing a directory of COCO annotation files, the importer returns a
List[List[AnnotationFile]]
type. This causes darwin-py to try flattening the list. If there are anyNoneType
s inparsed_files
at this point, aTypeError
will be thrown:'NoneType' object is not iterable.
Solution
These
NoneType
s inparsed_files
come from files that the importer was unable to parse. Therefore, remove allNoneType
s fromparsed_files
prior. Note that we can't simply filter for.json
files, since some annotation files are in the.xml
formatChangelog
Fixed rare bug when importing directories of COCO annotations