Hello, I would like to use Prodigy for simple labeling of images into 2 (or optionally more) categories streaming from a local images_dir
directory.
Think about cats vs dogs, or MNIST digits classification. I also don't care about integrating an active learning component as of now. In the binary case I'd like an image to appear with a single proposed label like
I tried to look for this in the forum and found
but to no avail...
I came up with a recipe.py
along the lines of
# coding: utf8
from __future__ import unicode_literals
import prodigy
from prodigy.components.loaders import Images
from prodigy.util import split_string
@prodigy.recipe('image-classification',
dataset=("The dataset to use", "positional", None, str),
source=("Path to a directory of images", "positional", None, str),
label=("One or more comma-separated labels", "option", "l", split_string)
)
def image_class(dataset, source, label=None):
stream = Images(source)
return {
'dataset': dataset, # Name of dataset to save annotations
'stream': stream, # Incoming stream of examples
'view_id': 'classification',
'config': {'label': label}
}
which I invoke with something along the lines of
prodigy image-classification my_dataset images_dir -l spam,eggs -F recipe.py
This fails in the UI with
ERROR: Can't fetch tasks.
and in the console with
Exception when serving /get_questions
Can someone amend my recipe above, or point me to an analog? I suspect the problem lies in the view_id
and config
syntax. I tried variations but with no luck..