tesseract  5.0.0-alpha-619-ge9db
tesstrain_utils.TrainingArgs Class Reference
Inheritance diagram for tesstrain_utils.TrainingArgs:

Public Member Functions

def __init__ (self)
 
def __eq__ (self, other)
 

Public Attributes

 uname
 
 lang_code
 
 timestamp
 
 font_config_cache
 
 fonts_dir
 
 max_pages
 
 save_box_tiff
 
 overwrite
 
 linedata
 
 run_shape_clustering
 
 extract_font_properties
 
 distort_image
 

Detailed Description

Definition at line 38 of file tesstrain_utils.py.

Constructor & Destructor Documentation

◆ __init__()

def tesstrain_utils.TrainingArgs.__init__ (   self)

Definition at line 39 of file tesstrain_utils.py.

39  def __init__(self):
40  super(TrainingArgs, self).__init__()
41  self.uname = platform.uname().system.lower()
42  self.lang_code = "eng"
43  self.timestamp = str(date.today())
44 
45  self._font_config_cache = TemporaryDirectory(prefix="font_tmp")
46  self.font_config_cache = self._font_config_cache.name
47  self.fonts_dir = (
48  "/Library/Fonts/" if "darwin" in self.uname else "/usr/share/fonts/"
49  )
50 
51  self.max_pages = 0
52  self.save_box_tiff = False
53  self.overwrite = False
54  self.linedata = False
55  self.run_shape_clustering = False
56  self.extract_font_properties = True
57  self.distort_image = False
58 

Member Function Documentation

◆ __eq__()

def tesstrain_utils.TrainingArgs.__eq__ (   self,
  other 
)

Definition at line 59 of file tesstrain_utils.py.

59  def __eq__(self, other):
60  return (argparse.Namespace.__eq__(self, other) and
61  self.uname == other.uname and self.lang_code == other.lang_code and
62  self.timestamp == other.timestamp and self.font_config_cache == other.font_config_cache and
63  self.fonts_dir == other.fonts_dir and self.max_pages == other.max_pages and
64  self.save_box_tiff == other.save_box_tiff and self.overwrite == other.overwrite and
65  self.linedata == other.linedata and self.run_shape_clustering == other.run_shape_clustering and
66  self.extract_font_properties == other.extract_font_properties and
67  self.distort_image == other.distort_image)
68 
69 

Member Data Documentation

◆ distort_image

tesstrain_utils.TrainingArgs.distort_image

Definition at line 57 of file tesstrain_utils.py.

◆ extract_font_properties

tesstrain_utils.TrainingArgs.extract_font_properties

Definition at line 56 of file tesstrain_utils.py.

◆ font_config_cache

tesstrain_utils.TrainingArgs.font_config_cache

Definition at line 46 of file tesstrain_utils.py.

◆ fonts_dir

tesstrain_utils.TrainingArgs.fonts_dir

Definition at line 47 of file tesstrain_utils.py.

◆ lang_code

tesstrain_utils.TrainingArgs.lang_code

Definition at line 42 of file tesstrain_utils.py.

◆ linedata

tesstrain_utils.TrainingArgs.linedata

Definition at line 54 of file tesstrain_utils.py.

◆ max_pages

tesstrain_utils.TrainingArgs.max_pages

Definition at line 51 of file tesstrain_utils.py.

◆ overwrite

tesstrain_utils.TrainingArgs.overwrite

Definition at line 53 of file tesstrain_utils.py.

◆ run_shape_clustering

tesstrain_utils.TrainingArgs.run_shape_clustering

Definition at line 55 of file tesstrain_utils.py.

◆ save_box_tiff

tesstrain_utils.TrainingArgs.save_box_tiff

Definition at line 52 of file tesstrain_utils.py.

◆ timestamp

tesstrain_utils.TrainingArgs.timestamp

Definition at line 43 of file tesstrain_utils.py.

◆ uname

tesstrain_utils.TrainingArgs.uname

Definition at line 41 of file tesstrain_utils.py.


The documentation for this class was generated from the following file: