An automated system for analyzing blood sample images from microscopes to detect anomalies using computer vision and machine learning techniques.
- Load and process microscope images of blood samples
- Detect and segment individual blood cells
- Extract features from blood cells
- Detect anomalies using machine learning
- Visualize and save analysis results
- Clone the repository:
git clone <repository-url>
cd BloodAnalysis- Create and activate a virtual environment (recommended):
python -m venv venv
.\venv\Scripts\Activate- Install dependencies:
pip install -r requirements.txtBloodAnalysis/
├── data/ # Data directory
│ ├── raw/ # Raw microscope images
│ └── processed/ # Processed images and results
├── models/ # Trained models
├── notebooks/ # Jupyter notebooks for analysis
├── src/ # Source code
│ ├── __init__.py
│ ├── image_processing.py # Image processing functions
│ ├── anomaly_detection.py # Anomaly detection model
│ └── main.py # Main script
├── tests/ # Unit tests
└── requirements.txt # Project dependencies
Analyze a blood sample image:
python src/main.py path/to/image.jpg --output results_folder --model path/to/modelfrom src.main import analyze_sample
# Analyze a single image
results = analyze_sample(
"path/to/image.jpg",
output_dir="results_folder",
model_path="path/to/model"
)pytest tests/This project uses:
- Black for code formatting
- Flake8 for linting
Format code:
black src/ tests/Run linter:
flake8 src/ tests/This project is licensed under the MIT License.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request