image.manual render images in desired order

Hello, I'm trying to do annotate a set of images with endings like "XXX-01.png", "XXX-02.png" etc. How can prodigy display the images in the desired order? The current session renders the images in random order.

Hi! By default, the images are presented in the order produced by Path("/your/source/directory").iterdir() – I always thought this would be alphabetic, but maybe it's actually by edited date? :thinking:

If you want to feed in your images in a custom order, the easiest way would be to load in a JSONL file with {"image": "/some/path.jpg"} etc. in your preferred order and then load it with --loader jsonl. Alternatively, if it'a not that many images, you could also consume the whole stream generator by calling list() around it in the recipe and then sort it in Python.

Great. Thanks. I have another issue regarding to image. manual. Suppose I don't add --no-fetch to my command, then the output of db-out would be really huge as it converts the image to 64 base. However, if I add --no-fetch to my command, the image would not be displayed.

The --no-fetch flag just decides whether local paths etc. in the data are loaded as base64, so you typically always want to set that if your input is a JSONL file with paths.

Whether the base64-encoded data is saved to the database can be toggled by setting --remove-base64. This will replace the image data with the path again. So if your input is a JSON file with file paths, you can set --no-fetch to load them and --remove-base64 to not store the encoded data in the DB.