MCPcopy
hub / github.com/PaddlePaddle/PaddleOCR / test_ppformulanet_l_backbone

Function test_ppformulanet_l_backbone

tests/ppocr/test_formula_model.py:155–173  ·  view source on GitHub ↗

Test PP-FormulaNet-L backbone. Args: sample_image_ppformulanet_l: sample image to be processed.

(sample_image_ppformulanet_l)

Source from the content-addressed store, hash-verified

153
154
155def test_ppformulanet_l_backbone(sample_image_ppformulanet_l):
156 """
157 Test PP-FormulaNet-L backbone.
158
159 Args:
160 sample_image_ppformulanet_l: sample image to be processed.
161 """
162 backbone = Vary_VIT_B_Formula(
163 image_size=768,
164 encoder_embed_dim=768,
165 encoder_depth=12,
166 encoder_num_heads=12,
167 encoder_global_attn_indexes=[2, 5, 8, 11],
168 )
169 backbone.eval()
170 with paddle.no_grad():
171 result = backbone(sample_image_ppformulanet_l)
172 encoder_feat = result[0]
173 assert encoder_feat.shape == [1, 144, 1024]
174
175
176def test_ppformulanet_l_head(encoder_feat_ppformulanet_l):

Callers

nothing calls this directly

Calls 2

Vary_VIT_B_FormulaClass · 0.90
evalMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…