Spaces:
Sleeping
Sleeping
Download test/test_ingestion.py from junaid17/DamageLensAI: direct link, hf CLI and curl.
- Browser
- Download file 708 Bytes
-
https://huggingface.co/spaces/junaid17/DamageLensAI/resolve/main/test/test_ingestion.py
- Command line
-
hf download hf://spaces/junaid17/DamageLensAI/test/test_ingestion.py
-
curl -L -o test_ingestion.py https://huggingface.co/spaces/junaid17/DamageLensAI/resolve/main/test/test_ingestion.py
708 Bytes
| import logging | |
| import os | |
| from src.data.ingestion import collect_image_paths | |
| logger = logging.getLogger(__name__) | |
| def test_ingestion(): | |
| logger.info("Testing ingestion...") | |
| samples = collect_image_paths() | |
| assert len(samples) > 0, "No samples found" | |
| image_path, label = samples[0] | |
| assert os.path.exists(image_path), "Image path missing" | |
| assert isinstance(label, int), "Label invalid" | |
| logger.info("Ingestion test passed.") | |
| if __name__ == "__main__": | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format="%(asctime)s - %(levelname)s - %(message)s" | |
| ) | |
| test_ingestion() | |
| print("Ingestion test completed successfully.") |