Skip to content

Commit 4a61cfa

Browse files
committed
Added new workertypes as well as a section about advanced usage
1 parent ffb34b9 commit 4a61cfa

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

docs/isquare_tutorial.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,13 @@ class ArchipelFacePixelizer(ImagesToImagesWorker):
6565
The imports specifies, along with any dependencies or additional functions or classes, which workertype we will be using. In our case, the model takes images as inputs and also return images (the same as before but the faces blurred), so we choose the `ImagesToImagesWorker`. The name of the workerclass always reflects inputs and outputs. For the moment, the following workers are available:
6666
- `ImagesToImagesWorker` (e.g. Face blurring)
6767
- `ImagesToDictsWorker` (e.g. classification or detection)
68+
- `ImagesToStringsWorker` (e.g. for image annotation)
6869
- `StringsToDictsWorker` (e.g. NLP model)
69-
More types will be added on the way. If the input outputs types you are looking for are not available, please let us know. In the meantime know thaht most data formats can be converted to strings!
70+
- `DictsToDictsWorker` (e.g. NLP model)
71+
- `StringsToImagesWorker` (e.g. Image generation from captions)
72+
- `DictsToImagesWorker` (e.g. Image generation from captions)
73+
- `DictsToStringsWorker` (e.g. NLP model)
74+
More types will be added on the way. If the input outputs types you are looking for are not available, please let us know by opening an issue. In the meantime know that most data formats can be converted to strings and dicts!
7075

7176
You can specify multiple classes and functions inside your workerscript (you can even write your whole code inside it, although we do not recommend it). The `__task_class_name__` specifies which class is your workerclass, in our case `ArchipelFacePixeliser`.
7277

@@ -205,6 +210,21 @@ self.log(threshold_value)
205210
This value is now logged, and you can retrieve it on your dashboard on isquare.ai. In this way, the parameters of the model can be adpated to fit the real life data, and the real performance of the model assessed.
206211
We highly encourage monitoring apropriate metrics for your model, in this way you'll always know how well your model is really performing.
207212

213+
## Advanced usage
214+
215+
### Defining an example input
216+
Isquare will automatically test your model by generating an input corresponding to your worker class, with one exception: All `DictsToXWorker` workers. It could also be that you want to test your worker with a very specific input. In either of those cases, you can override the `get_dump_input` method of your worker, for example, as follows:
217+
```python
218+
class MusicalTastePredictor(DictsToDictsWorker):
219+
"""Predicts musical taste from completely arbitrary information."""
220+
...
221+
...
222+
def get_dump_input(self):
223+
return {"Name":"John","Origin": "Switzerland","Age":18}
224+
225+
```
226+
227+
208228

209229

210230

0 commit comments

Comments
 (0)