Spaces:
Build error
Build error
Download tests/test_preprocess.py from Varun2007/pageparse.ai: direct link, hf CLI and curl.
- Browser
- Download file 656 Bytes
-
https://huggingface.co/spaces/Varun2007/pageparse.ai/resolve/main/tests/test_preprocess.py
- Command line
-
hf download hf://spaces/Varun2007/pageparse.ai/tests/test_preprocess.py
-
curl -L -o test_preprocess.py https://huggingface.co/spaces/Varun2007/pageparse.ai/resolve/main/tests/test_preprocess.py
656 Bytes
| # SPDX-FileCopyrightText: 2026 Team Centurions | |
| # SPDX-License-Identifier: AGPL-3.0-or-later | |
| import numpy as np | |
| from pageparse.preprocess import preprocess | |
| def test_preprocess_grayscale(): | |
| img = np.random.randint(0, 256, (100, 200, 3), dtype=np.uint8) | |
| result = preprocess(img) | |
| assert result.ndim == 2 | |
| assert result.dtype == np.uint8 | |
| def test_preprocess_already_gray(): | |
| img = np.random.randint(0, 256, (100, 200), dtype=np.uint8) | |
| result = preprocess(img) | |
| assert result.shape == (100, 200) | |
| def test_preprocess_empty(): | |
| img = np.zeros((50, 50), dtype=np.uint8) | |
| result = preprocess(img) | |
| assert result is not None | |