mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-22 22:27:17 +00:00
Merge branch 'master' into otp
This commit is contained in:
commit
0b8ff17c5b
3 changed files with 8 additions and 2 deletions
|
@ -440,7 +440,11 @@ def delete_obj_translation(obj_global_id, language, field=''):
|
||||||
class LanguagesDetector:
|
class LanguagesDetector:
|
||||||
|
|
||||||
def __init__(self, nb_langs=3, min_proportion=0.2, min_probability=-1, min_len=0):
|
def __init__(self, nb_langs=3, min_proportion=0.2, min_probability=-1, min_len=0):
|
||||||
self.lt = LibreTranslateAPI(get_translator_instance())
|
lt_url = get_translator_instance()
|
||||||
|
if not lt_url:
|
||||||
|
self.lt = None
|
||||||
|
else:
|
||||||
|
self.lt = LibreTranslateAPI(get_translator_instance())
|
||||||
try:
|
try:
|
||||||
self.lt.languages()
|
self.lt.languages()
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
|
@ -9,6 +9,7 @@ The OcrExtractor Module
|
||||||
##################################
|
##################################
|
||||||
# Import External packages
|
# Import External packages
|
||||||
##################################
|
##################################
|
||||||
|
import cv2
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -103,7 +104,7 @@ class OcrExtractor(AbstractModule):
|
||||||
print(image.id, languages)
|
print(image.id, languages)
|
||||||
try:
|
try:
|
||||||
texts = Ocrs.extract_text(path, languages)
|
texts = Ocrs.extract_text(path, languages)
|
||||||
except ValueError as e:
|
except (OSError, ValueError, cv2.error) as e:
|
||||||
self.logger.warning(e)
|
self.logger.warning(e)
|
||||||
self.obj.add_tag('infoleak:confirmed="false-positive"')
|
self.obj.add_tag('infoleak:confirmed="false-positive"')
|
||||||
texts = None
|
texts = None
|
||||||
|
|
|
@ -72,6 +72,7 @@ popd
|
||||||
# pgpdump
|
# pgpdump
|
||||||
test ! -d pgpdump && git clone https://github.com/kazu-yamamoto/pgpdump.git
|
test ! -d pgpdump && git clone https://github.com/kazu-yamamoto/pgpdump.git
|
||||||
pushd pgpdump/
|
pushd pgpdump/
|
||||||
|
autoreconf -fiW all
|
||||||
./configure
|
./configure
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
Loading…
Reference in a new issue