You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PngImageFile if is_base64 is False, or the base64 encoded string of the image if is_base64 is True.
21
23
is_base64 : bool, optional
22
-
Indicates whether the image_PIL_or_base64 parameter is an PngImageFile or a base64 encoded string, by default False.
24
+
Indicates whether the image_PIL_or_base64 parameter is an PngImageFile or a base64 encoded string.
23
25
24
26
Returns
25
27
-------
26
28
latex : str
27
-
The LaTeX representation of the mathematical formula recognized in the image. Raises an exception if the image is not recognized as containing a mathematical formula.
29
+
The LaTeX representation of the mathematical formula recognized in the image.
30
+
Raises an exception if the image is not recognized as containing a mathematical formula.
28
31
29
32
Raises
30
33
------
31
34
FormulaRecognitionError
32
-
If the HTTP request does not return a 200 status code, if there is an error processing the response, or if the image is not recognized as a mathematical formula.
35
+
If the HTTP request does not return a 200 status code,
36
+
if there is an error processing the response,
37
+
if the image is not recognized as a mathematical formula.
Recognizes mathematical formulas within figures from a given source, which can be either a base64 string or an identifier for a figure within a provided dictionary.
97
+
Recognizes mathematical formulas within figures from a given source,
98
+
which can be either a base64 string or an identifier for a figure within a provided dictionary.
83
99
84
100
Parameters
85
101
----------
86
102
src : str
87
-
The source from which the figure is to be recognized. It can be a base64 encoded string of the image if is_base64 is True, or an identifier for the figure if is_base64 is False.
103
+
The source from which the figure is to be recognized.
104
+
It can be a base64 encoded string of the image if is_base64 is True,
105
+
or an identifier for the figure if is_base64 is False.
88
106
is_base64 : bool, optional
89
107
Indicates whether the src parameter is a base64 encoded string or an identifier, by default False.
90
108
figure_instances : dict, optional
91
-
A dictionary mapping figure identifiers to their corresponding PngImageFile, by default None. This is only required and used if is_base64 is False.
109
+
A dictionary mapping figure identifiers to their corresponding PngImageFile, by default None.
110
+
This is only required and used if is_base64 is False.
92
111
93
112
Returns
94
113
-------
95
114
forumla_figure_latex : str or None
96
-
The LaTeX representation of the mathematical formula recognized within the figure. Returns None if no formula is recognized or if the figure_instances dictionary does not contain the specified figure identifier when is_base64 is False.
115
+
The LaTeX representation of the mathematical formula recognized within the figure.
116
+
Returns None if no formula is recognized or
117
+
if the figure_instances dictionary does not contain the specified figure identifier when is_base64 is False.
This function relies on `ocr_formula_figure` for the actual OCR (Optical Character Recognition) process. Ensure that `ocr_formula_figure` is correctly implemented and can handle both base64 encoded strings and PngImageFile as input.
142
+
This function relies on `ocr_formula_figure` for the actual OCR (Optical Character Recognition) process.
143
+
Ensure that `ocr_formula_figure` is correctly implemented and can handle base64 encoded strings and PngImageFile.
0 commit comments