Skip to content

Locate basic landmarks on cephalograms with AI (Pytorch)

Notifications You must be signed in to change notification settings

zhangted/py-ceph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Predict Landmarks on a Cephalogram

PyTorch solution to find 19 cephalometric landmarks from a lateral cephalogram from CLI.

Model provided to predict landmarks is trained from the source code and datasets from Cephalometric Landmark Detection by Attentive Feature Pyramid Fusion and Regression-Voting. Repo here.


How to use py-ceph?

  pip install git+https://github.com/zhangted/py-ceph

Python (Usage Examples)

  from pyceph.pyceph import predict

  results = predict(image_src='tests/test-images/001.jpg', device='cpu')
  for res in results: print(res)

  """
  {'Sella': (274, 369), 'Nasion': (472, 358), 'Orbitale': (429, 447), 'Porion': (204, 424), 'Subspinale': (468, 542), 'Supramentale': (446, 669), 'Pogonion': (440, 716), 'Menton': (418, 740), 'Gnathion': (433, 732), 'Gonion': (237, 635), 'Incision Inferius': (470, 609), 'Incision Superius': (476, 612), 'Upper Lip': (521, 585), 'Lower Lip': (503, 654), 'Subnasale': (507, 542), 'Soft Tissue Pogonion': (485, 727), 'Posterior Nasal Spine': (319, 511), 'Anterior Nasal Spine': (474, 518), 'Articulare': (223, 473)}
  """

  results = predict(image_folder='tests/test-images', device=0)

Single file processing (CLI)

  py-ceph --image_src "image path string"

Output

  • image with landmarks shown in pyplot viewer
  • labeled landmarks displayed in console

single file processing example

Batch processing (CLI)

  py-ceph --image_folder "image folder path string"

Output

  • create predicted_images folder in provided directory
    • image overlayed with predicted landmarks
    • csv with the coordinates for each labeled landmark




Testing

In the app directory, run

  pytest

To-do

  • Non-CLI usage
  • PyPi package

Dependencies

  • Python 3.10+
  • pyyaml
  • pytest
  • torch
  • numpy
  • torch
  • matplotlib
  • scikit-image

Releases

No releases published

Packages

No packages published

Languages