This project performs grayscale skin tissue image segmentation using value-set based masking logic derived from training masks.
For each test scan, the model segments pixels into the following classes:
- Dermal-epidermal junction
- Dermis
- Epidermis
- Keratin / stratum corneum
- Background
The full problem statement is available here:
Download the dataset from:
- main.py: Entry point for running segmentation on test scans
- vset.py: Builds class-specific value sets and applies segmentation
- calc.py: Pixel-wise segmentation helper functions
- constant.py: Loads dataset paths from environment variables
- .env.example: Template for local environment configuration
This project uses Python 3.10+ and the dependencies listed in requirements.txt:
- opencv-python
- scikit-learn
- numpy
- python-dotenv
- torch
- torchvision
Install dependencies:
pip install -r requirements.txtCreate a local .env file in the project root (you can copy .env.example) and set these values:
TRAIN_FILES_PATH=
TRAIN_MASKS_PATH=
TEST_FILES_PATH=
TEST_MASKS_PATH=Path tips:
- Use absolute paths or carefully validated relative paths.
- Ensure each path points to the correct folder that contains the images.
- On Windows, both forward slashes and escaped backslashes are acceptable.
From the project root folder:
python main.pyThe script will:
- Detect whether CUDA is available.
- Build value sets from training images and masks.
- Segment all test scans from TEST_FILES_PATH.
- Save generated segmentation results to the output folder.
Segmented files are written to a results folder path used by the runtime.
Current code target:
- ./results/
If you want a folder named Result instead, update the output path in main.py accordingly.
- Ensure training images and masks are correctly paired.
- Keep file naming consistent between image and mask directories.
- Verify read/write permissions for input and output folders.
Abdullah Uppal