Instapy: Feature Request: Clarifai custom Model Workflow

Created on 26 Dec 2017  路  1Comment  路  Source: timgrossmann/InstaPy

Bountysource

Expected Behavior

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

Current Behavior

InstaPy reads out of the box tags from Clarifai database.

Possible Solution (optional)

Add custom workflow model to clarifiai_util.py

InstaPy configuration

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")

Note

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()

bounty feature request

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

>All comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Spyd3r0us picture Spyd3r0us  路  3Comments

harrypython picture harrypython  路  3Comments

46960 picture 46960  路  3Comments

ghost picture ghost  路  3Comments

rahulkapoor90 picture rahulkapoor90  路  3Comments