PosixPath error when trying to create an ObjectCategoryList from_folder

I’m trying to import some data for detecting features. I’ve written a function called get_bbox to convert filenames to ImageBBoxs and it seems to be working well. When I try to import all the data I get the error TypeError: 'PosixPath' object does not support indexing. The lines of code in the error all seem to point to parts of the fast AI library.

data = (ObjectCategoryList.from_folder(path)
    .transform(get_transforms(), tfm_y=True)

Things I’ve tried:

  • Rewriting get_bbox to not use posix paths at all
  • Shortcircuiting get_bbox so it isn’t called
  • reading through the fastai library code to try to understand what is going on.

Does anyone have any other ideas?