Changes

Jump to navigation Jump to search
Line 47: Line 47:  
Andros France||Andros
 
Andros France||Andros
 
andros||Andros
 
andros||Andros
 +
</pre>
 +
 +
 +
=== Add a new type of detection ===
 +
* Create a file `fishing_flashtext.txt` and add one value to extract per line
 +
 +
=== Add it to the Robotoff settings ===
 +
<pre>
 +
robotoff/settings.py
 +
OCR_LABEL_WHITELIST_DATA_PATH = OCR_DATA_DIR / "label_whitelist.txt"
 +
OCR_FISHING_FLASHTEXT_DATA_PATH = OCR_DATA_DIR / "fishing_flashtext.txt"
 +
</pre>
 +
 +
=== Plug it into the OCR pipeline ===
 +
<pre>
 +
robotoff/insights/ocr/packager_code.py
 +
    codes = text_file_iter(settings.OCR_FISHING_FLASHTEXT_DATA_PATH)
 +
    return generate_keyword_processor(("{}||{}".format(c.upper(), c) for c in codes))
 
</pre>
 
</pre>

Navigation menu