InstaPy to read Workflow tags from custom trained models from Clarifai.
You can train Clarifai to read your custom images and create models out of it. For example Clarifai doesn't know what a Blackhead Mask or Facemask is, but you can train it to do so.
You can read more about workflow models here https://clarifai.com/developer/guide/workflow#workflow
InstaPy reads out of the box tags from Clarifai database.
Add custom workflow model to clarifiai_util.py
clarifiai_util.py will need the following additions:
from clarifai.rest import ClarifaiApp
from clarifai.rest import Workflow
.......
workflow = Workflow(clarifai_api.api, workflow_id="YOUR_ID")
The custom workflow model uses a different response than the out of the box model.
Workflow model to get tag name is
clarifai_tags = [concept.get('name').lower() for concept in result[
'results'][0]['outputs'][0]['data']['concepts']]
Keep in mind that when you are using a custom model your tags will show up on every image search, so we will have to only comment when the value of the keyword is a high probability:
clarifai_tags_value= [concept.get('value') for concept in result[
'results'][0]['outputs'][0]['data']['concepts']]
Maybe you can set the probability range as a parameter on session.clarifai_check_img_for()
I got it working just fine. Its manual code, but it works. Still would like to see this feature done correctly so there is a bounty for it https://www.bountysource.com/issues/53120258-feature-request-clarifai-custom-model-workflow
Most helpful comment
I got it working just fine. Its manual code, but it works. Still would like to see this feature done correctly so there is a bounty for it https://www.bountysource.com/issues/53120258-feature-request-clarifai-custom-model-workflow