Connect an OCR model

P4 Search uses Tesseract and ImageMagick for optical character recognition (OCR). See Enable image OCR.

You can choose to connect a cloud model instead. Follow these instructions to connect and configure an OCR model for P4 Search.

To learn more about setting configurations manually, see Configure P4 Search locally.

Set up auto-OCR with Azure OCR

  1. Set the auto-ocr model to AzureOcrModel:

  2. com.perforce.p4search.auto-ocr.model=AzureOcrModel

  3. Specify the auto-tagging service hostname. For example:

  4. com.perforce.p4search.auto-detect.host=https://my.cognitiveservices.azure.com

  5. Specify the language you want the image tags to be generated in, see your auto-tagging service documentation for supported languages. For example:

  6. com.perforce.p4search.auto-detect.lang=en

  7. Enter the API key for your auto-tagging service. For example:

  8. 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

  1. Set the auto-ocr model to RekognitionOcrModel, for example:

  2. com.perforce.p4search.auto-ocr.model=RekognitionOcrModel

  3. Specify the auto-tagging service region as host. For example:

  4. com.perforce.p4search.auto-detect.host=us-east-2

  5. Specify the language you want the image tags to be generated in. See your auto-tagging service documentation for supported languages. For example:

  6. com.perforce.p4search.auto-detect.lang=en

  7. 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:

  8. 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

  1. Set the auto-ocr model to GoogleOcrModel:

  2. com.perforce.p4search.auto-ocr.model=GoogleOcrModel

  3. Specify the auto-tagging service hostname. For example:

  4. com.perforce.p4search.auto-detect.host=https://vision.googleapis.com

  5. Specify the language you want the image tags to be generated in. See your auto-tagging service documentation for supported languages. For example:

  6. com.perforce.p4search.auto-detect.lang=en

  7. Enter the API key for your auto-tagging service. For example:

  8. 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