ragflow/deepdoc/vision
Mathias Panzenböck 6b389e01b5
Remove use of eval() from operators.py (#4888)
Use `np.float32()` instead.

### What problem does this PR solve?

Using `eval()` can lead to code injections.

I think `eval()` is only used to parse a floating point number here.
This change preserves the correct behavior if the string `"None"` is
supplied. But if that behavior isn't intended then this part could be
just deleted instead, since `np.float32()` is parsing strings anyway:

```Python
        if isinstance(scale, str):
            scale = eval(scale)
```

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
2025-02-12 12:53:42 +08:00
..
__init__.py Fix t_ocr.py for PNG image. (#4625) 2025-01-24 11:47:27 +08:00
layout_recognizer.py Update comments (#4569) 2025-01-21 20:52:28 +08:00
ocr.py Added cuda_is_available (#4725) 2025-02-05 18:01:23 +08:00
ocr.res Format file format from Windows/dos to Unix (#1949) 2024-08-15 09:17:36 +08:00
operators.py Remove use of eval() from operators.py (#4888) 2025-02-12 12:53:42 +08:00
postprocess.py Remove usage of eval() from postprocess.py (#4571) 2025-01-22 19:37:24 +08:00
recognizer.py Added cuda_is_available (#4725) 2025-02-05 18:01:23 +08:00
seeit.py Update comments (#4569) 2025-01-21 20:52:28 +08:00
t_ocr.py Update comments (#4569) 2025-01-21 20:52:28 +08:00
t_recognizer.py Update comments (#4569) 2025-01-21 20:52:28 +08:00
table_structure_recognizer.py Update comments (#4569) 2025-01-21 20:52:28 +08:00