Class: Kreuzberg::Config::PaddleOcr
- Inherits:
-
Object
- Object
- Kreuzberg::Config::PaddleOcr
- Defined in:
- lib/kreuzberg/config.rb
Overview
PaddleOCR engine configuration
Instance Attribute Summary collapse
-
#cache_dir ⇒ Object
readonly
Returns the value of attribute cache_dir.
-
#det_db_box_thresh ⇒ Object
readonly
Returns the value of attribute det_db_box_thresh.
-
#det_db_thresh ⇒ Object
readonly
Returns the value of attribute det_db_thresh.
-
#det_db_unclip_ratio ⇒ Object
readonly
Returns the value of attribute det_db_unclip_ratio.
-
#det_limit_side_len ⇒ Object
readonly
Returns the value of attribute det_limit_side_len.
-
#enable_table_detection ⇒ Object
readonly
Returns the value of attribute enable_table_detection.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#rec_batch_num ⇒ Object
readonly
Returns the value of attribute rec_batch_num.
-
#use_angle_cls ⇒ Object
readonly
Returns the value of attribute use_angle_cls.
Instance Method Summary collapse
-
#initialize(language: nil, cache_dir: nil, use_angle_cls: nil, enable_table_detection: nil, det_db_thresh: nil, det_db_box_thresh: nil, det_db_unclip_ratio: nil, det_limit_side_len: nil, rec_batch_num: nil) ⇒ PaddleOcr
constructor
A new instance of PaddleOcr.
- #to_h ⇒ Object
Constructor Details
#initialize(language: nil, cache_dir: nil, use_angle_cls: nil, enable_table_detection: nil, det_db_thresh: nil, det_db_box_thresh: nil, det_db_unclip_ratio: nil, det_limit_side_len: nil, rec_batch_num: nil) ⇒ PaddleOcr
Returns a new instance of PaddleOcr.
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/kreuzberg/config.rb', line 107 def initialize( language: nil, cache_dir: nil, use_angle_cls: nil, enable_table_detection: nil, det_db_thresh: nil, det_db_box_thresh: nil, det_db_unclip_ratio: nil, det_limit_side_len: nil, rec_batch_num: nil ) @language = language&.to_s @cache_dir = cache_dir&.to_s @use_angle_cls = boolean_or_nil(use_angle_cls) @enable_table_detection = boolean_or_nil(enable_table_detection) @det_db_thresh = det_db_thresh&.to_f @det_db_box_thresh = det_db_box_thresh&.to_f @det_db_unclip_ratio = det_db_unclip_ratio&.to_f @det_limit_side_len = det_limit_side_len&.to_i @rec_batch_num = rec_batch_num&.to_i end |
Instance Attribute Details
#cache_dir ⇒ Object (readonly)
Returns the value of attribute cache_dir.
103 104 105 |
# File 'lib/kreuzberg/config.rb', line 103 def cache_dir @cache_dir end |
#det_db_box_thresh ⇒ Object (readonly)
Returns the value of attribute det_db_box_thresh.
103 104 105 |
# File 'lib/kreuzberg/config.rb', line 103 def det_db_box_thresh @det_db_box_thresh end |
#det_db_thresh ⇒ Object (readonly)
Returns the value of attribute det_db_thresh.
103 104 105 |
# File 'lib/kreuzberg/config.rb', line 103 def det_db_thresh @det_db_thresh end |
#det_db_unclip_ratio ⇒ Object (readonly)
Returns the value of attribute det_db_unclip_ratio.
103 104 105 |
# File 'lib/kreuzberg/config.rb', line 103 def det_db_unclip_ratio @det_db_unclip_ratio end |
#det_limit_side_len ⇒ Object (readonly)
Returns the value of attribute det_limit_side_len.
103 104 105 |
# File 'lib/kreuzberg/config.rb', line 103 def det_limit_side_len @det_limit_side_len end |
#enable_table_detection ⇒ Object (readonly)
Returns the value of attribute enable_table_detection.
103 104 105 |
# File 'lib/kreuzberg/config.rb', line 103 def enable_table_detection @enable_table_detection end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
103 104 105 |
# File 'lib/kreuzberg/config.rb', line 103 def language @language end |
#rec_batch_num ⇒ Object (readonly)
Returns the value of attribute rec_batch_num.
103 104 105 |
# File 'lib/kreuzberg/config.rb', line 103 def rec_batch_num @rec_batch_num end |
#use_angle_cls ⇒ Object (readonly)
Returns the value of attribute use_angle_cls.
103 104 105 |
# File 'lib/kreuzberg/config.rb', line 103 def use_angle_cls @use_angle_cls end |
Instance Method Details
#to_h ⇒ Object
129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/kreuzberg/config.rb', line 129 def to_h { language: @language, cache_dir: @cache_dir, use_angle_cls: @use_angle_cls, enable_table_detection: @enable_table_detection, det_db_thresh: @det_db_thresh, det_db_box_thresh: @det_db_box_thresh, det_db_unclip_ratio: @det_db_unclip_ratio, det_limit_side_len: @det_limit_side_len, rec_batch_num: @rec_batch_num }.compact end |