label-studio-ml-backend icon indicating copy to clipboard operation
label-studio-ml-backend copied to clipboard

Tutorial with pytorch is missing substantial parts

Open MalteEbner opened this issue 3 years ago • 2 comments

I want to use the label studio ml backend together with an image classification dataset and a pretrained pytorch model. There seems to be a blog / tutorial for it: https://labelstud.io/tutorials/pytorch-image-transfer-learning.html

However, this tutorial is missing substantial parts:

  • ImageClassifierDataset._get_image_from_url(self, url) is not implemented.
  • ImageClassifierAPI.__init__() uses the variable resources, which is never defined.
  • ImageClassifierDataset is never used.
  • ImageClassifierAPI.predict(self, tasks, **kwargs) and ImageClassifierAPI.fit(self, completions, **kwargs) are not implemented. In general, I found it hard to find out anything about the types/contents of the input arguments: E.g. What is the content of tasks[0], or what is the required output format? This prevented my from implementing it myself.

Ideally, the tutorial would also come with an example dataset running it through. E.g. use the clothing dataset small which is very easily downloadable: git clone https://github.com/alexeygrigorev/clothing-dataset-small.git

MalteEbner avatar Aug 16 '21 15:08 MalteEbner

Bump.

The tutorial is not up to date with https://github.com/heartexlabs/label-studio-ml-backend/blob/master/label_studio_ml/examples/pytorch_transfer_learning/pytorch_transfer_learning.py.

jrdalenberg avatar Jun 15 '22 08:06 jrdalenberg

Hi @MalteEbner The tutorial is only an example how to use pytorch with Label Studio. As for the params you can check this tutorial to understand LS tasks format.

KonstantinKorotaev avatar Jun 16 '22 11:06 KonstantinKorotaev