Connect an OCR model
You can connect an optical character recognition (OCR) model to P4 Search and configure it. By default, P4 Search uses Tesseract and ImageMagick for OCR. See Enable image OCR.
To learn more about setting configurations manually, see Configure P4 Search locally.
On this page:
Set up auto-OCR with Azure OCR
-
Set the auto-ocr model to AzureOcrModel:
-
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:
com.perforce.p4search.auto-ocr.model=AzureOcrModel
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
All the configurations together:
com.perforce.p4search.auto-ocr.model=AzureOcrModel
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
Set up auto-OCR with Rekognition OCR
-
Set the auto-ocr model to RekognitionOcrModel, for example:
-
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 RekognitionOcrModel is a combination of <aws_access_key_id> and <aws_secret_access_key>. For example:
com.perforce.p4search.auto-ocr.model=RekognitionOcrModel
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
All the configurations together:
com.perforce.p4search.auto-ocr.model=RekognitionOcrModel
com.perforce.p4search.auto-detect.host=us-east-2
com.perforce.p4search.auto-detect.lang=en
com.perforce.p4search.auto-detect.key=ABCDEFGHIJKL12345678:ab0cd1ef2gh3IJ4aaaBBBcccWWW111rfc1234YERTpp
Set up auto-OCR with Google OCR
-
Set the auto-ocr model to GoogleOcrModel:
-
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:
com.perforce.p4search.auto-ocr.model=GoogleOcrModel
com.perforce.p4search.auto-detect.host=https://vision.googleapis.com
com.perforce.p4search.auto-detect.lang=en
com.perforce.p4search.auto-detect.key=AbcdEFG12345ZXvfe56210QWErtyui123456789
All the configurations together:
com.perforce.p4search.auto-ocr.model=GoogleOcrModel
com.perforce.p4search.auto-detect.host=https://vision.googleapis.com
com.perforce.p4search.auto-detect.lang=en
com.perforce.p4search.auto-detect.key=AbcdEFG12345ZXvfe56210QWErtyui123456789