Skip to content

AI system to segment and measure periorbital features from color photographs

License

Notifications You must be signed in to change notification settings

uw-biomedical-ml/periorbitAI

Repository files navigation

periorbitAI

AI system to segment and measure periorbital features from color photographs

In this repo you will find a python script (run_periorbitAI.py) to segment a color photograph (in JPG format) and calculate the periorbital measures described in https://doi.org/10.1016/j.ajo.2021.05.007.

It takes two inputs a root directory name and a directory name containing all photographs:

python run_periorbitAI.py root_directory name_of_photo_directory

Example:

python run_periorbitAI.py /data/periorbitAI photos

test

It will create:

  1. a directory "periorbitAI_figures" where it will put a segmetation overlay and a report with periorbital measures Screen Shot 2021-06-01 at 4 09 15 PM

test_report

  1. a csv (periorbitAI_measures.csv) with the measures in mm for each subject (subject IDs are determined by JPG names) Screen Shot 2021-06-01 at 4 05 43 PM

We provide an example photograph in "photos" and the output for this photo in "example_output," shown above.

Citation

Please cite this paper when using this repo:

Alexandra Van Brummen, Julia P. Owen, Theodore Spaide, Colin Froines, Randy Lu, Megan Lacy, Marian Blazes, Emily Li, Cecilia S. Lee, Aaron Y. Lee, Matthew Zhang, PeriorbitAI: Artificial intelligence automation of eyelid and periorbital measurements, American Journal of Ophthalmology, 2021

Installation

You must install the following Python packages:

pytorch (1.4.0)

scipy

scikit-image

numpy

torchvision

psd_tools

imutils

cv2

conda install pytorch=1.4.0 scipy=1.4.1 scikit-image=0.16.2 numpy=1.18.1 torchvision=0.5.0 psd-tools=1.8.38 imutils=0.5.3
pip install opencv-python

Donwloading the repo Due to the size of the segmentation model (>100MB) this repo has to be downloaded a release. Please follow these instructions:

  1. Go to https://github.com/uw-biomedical-ml/periorbitAI
  2. Click on Release: periorbitAI_v1.0 to the right of the page
  3. Download source code (either *.zip or *tar.gz)
  4. Download PSPNet_best
  5. Unzip/untar the source code repository (this may be needed: tar -xf v1.0.tar.gz --no-same-owner)
  6. Place PSPNet_best into the code repo
  7. You should now be able to run from within the code repo:
  python run_periorbitAI.py root_directory name_of_photo_directory

About

AI system to segment and measure periorbital features from color photographs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages