Connect an image tagging model
Follow these instructions to connect and configure an image tagging model for P4 Search.
To learn more about setting configurations manually, see Configure P4 Search locally.
On this page:
Set up auto-tagging with Azure Tags
-
Set the auto-tagging model to AzureTagsModel:
-
Specify the auto-tagging service hostname. For example:
-
Specify the language you want the image tags to be generated in. See your auto-tagging service documentation for supported languages. For example:
-
Enter the API key for your auto-tagging service. For example:
-
Specify the automatic image detection threshold for your auto-tagging service as a floating point percentage. For example, 0.1=10%:
-
Specify the automatic best image detection results limit. Defaults to 10 results:
com.perforce.p4search.auto-detect.model=AzureTagsModel
com.perforce.p4search.auto-detect.host=https://my.cognitiveservices.azure.com
com.perforce.p4search.auto-detect.lang=en
com.perforce.p4search.auto-detect.key=0123456789ABCDEF0123456789ABCDEF
com.perforce.p4search.auto-detect.threshold=0.1
com.perforce.p4search.auto-detect.best=10
All the configurations together:
com.perforce.p4search.auto-detect.model=AzureTagsModel
com.perforce.p4search.auto-detect.host=https://my.cognitiveservices.azure.com
com.perforce.p4search.auto-detect.lang=en
com.perforce.p4search.auto-detect.key=0123456789ABCDEF0123456789ABCDEF
com.perforce.p4search.auto-detect.threshold=0.1
com.perforce.p4search.auto-detect.best=10
Set up auto-tagging with Rekognition Labels
-
Set the auto-tagging model to RekognitionLabelsModel:
-
Specify the auto-tagging service region as host. For example:
-
Specify the language you want the image tags to be generated in. See your auto-tagging service documentation for supported languages. For example:
-
Enter the API key for your auto-tagging service. The API key for the AWS Rekognition is a combination of <aws_access_key_id> and <aws_secret_access_key>. For example:
-
Specify the automatic image detection threshold for your auto-tagging service as a floating point percentage. For example, 0.1=10%:
-
Specify the automatic best image detection results limit. Defaults to 10 results:
com.perforce.p4search.auto-detect.model=RekognitionLabelsModel
com.perforce.p4search.auto-detect.host=us-east-2
com.perforce.p4search.auto-detect.lang=en
com.perforce.p4search.auto-detect.key=<aws_access_key_id>:<aws_secret_access_key>
where
ws_access_key_id=ABCDEFGHIJKL12345678
ws_secret_access_key=ab0cd1ef2gh3IJ4aaaBBBcccWWW111rfc1234YERTpp
gives
com.perforce.p4search.auto-detect.key=ABCDEFGHIJKL12345678:ab0cd1ef2gh3IJ4aaaBBBcccWWW111rfc1234YERTpp
com.perforce.p4search.auto-detect.threshold=0.1
com.perforce.p4search.auto-detect.best=10
All the configurations together:
com.perforce.p4search.auto-detect.model=RekognitionLabelsModel
com.perforce.p4search.auto-detect.host=us-east-2
com.perforce.p4search.auto-detect.lang=en
com.perforce.p4search.auto-detect.key=ABCDEFGHIJKL12345678:ab0cd1ef2gh3IJ4aaaBBBcccWWW111rfc1234YERTpp
com.perforce.p4search.auto-detect.threshold=0.1
com.perforce.p4search.auto-detect.best=10
Set up auto-tagging with Google Labels
-
Set the auto-tagging model to GoogleLabelModel:
-
Specify the auto-tagging service hostname. For example:
-
Specify the language you want the image tags to be generated in. See your auto-tagging service documentation for supported languages. For example:
-
Enter the API key for your auto-tagging service. For example:
-
Specify the automatic image detection threshold for your auto-tagging service as a floating point percentage. For example, 0.1=10%:
-
Specify the automatic best image detection results limit. Defaults to 10 results:
com.perforce.p4search.auto-detect.model=GoogleLabelModel
com.perforce.p4search.auto-detect.host=https://vision.googleapis.com
com.perforce.p4search.auto-detect.lang=en
com.perforce.p4search.auto-detect.key=AbcdEFG12345ZXvfe56210QWErtyui123456789
com.perforce.p4search.auto-detect.threshold=0.1
com.perforce.p4search.auto-detect.best=10
All the configurations together:
com.perforce.p4search.auto-detect.model=GoogleLabelModel
com.perforce.p4search.auto-detect.host=https://vision.googleapis.com
com.perforce.p4search.auto-detect.lang=en
com.perforce.p4search.auto-detect.key=AbcdEFG12345ZXvfe56210QWErtyui123456789
com.perforce.p4search.auto-detect.threshold=0.1
com.perforce.p4search.auto-detect.best=10
Set up auto-tagging with DeepDetect
-
Set the auto-tagging model to DeepDetectModel:
-
Specify the auto-tagging service hostname. For example:
-
Specify the language you want the image tags to be generated in. See your auto-tagging service documentation for supported languages.
DeepDetect does not support multiple languages. Leave empty for DeepDetect:
-
Enter the API key for your auto-tagging service.
DeepDetect does not support an API key. Default is empty:
-
Specify the automatic image detection threshold for your auto-tagging service as a floating point percentage. For example, 0.1=10%:
-
Specify the automatic best image detection results limit. Defaults to 10 results:
- Specify the classification service you want to use for image tags. For example,
classification_21kif you are using the DeepDetect 21k pre-trained model:
com.perforce.p4search.auto-detect.model=DeepDetectModel
com.perforce.p4search.auto-detect.host=https://localhost:8888
com.perforce.p4search.auto-detect.lang=
com.perforce.p4search.auto-detect.key=
com.perforce.p4search.auto-detect.threshold=0.1
com.perforce.p4search.auto-detect.best=10
com.perforce.p4search.auto-detect.service=classification_21k
All the configurations together:
com.perforce.p4search.auto-detect.model=DeepDetectModel
com.perforce.p4search.auto-detect.host=http://localhost:8888
com.perforce.p4search.auto-detect.lang=
com.perforce.p4search.auto-detect.key=
com.perforce.p4search.auto-detect.threshold=0.1
com.perforce.p4search.auto-detect.best=10
com.perforce.p4search.auto-detect.service=classification_21k
To learn more about using a pretrained model, see DeepDetect's Setup of an image classifier.
Example curl request to load the DeepDetect 21k pretrained model:
curl -H "Content-Type: application/x-www-form-urlencoded" -X PUT
-d '{
"description": "generic image classification service",
"model": {
"repository": "/opt/models/classification_21k",
"init":"https://deepdetect.com/models/init/desktop/images/classification/classification_21k.tar.gz",
"create_repository": true
},
"mllib": "caffe",
"type": "supervised",
"parameters": {
"input": {
"connector": "image"
}
}
}' http://localhost:8888/services/classification_21k