Skip to content

Corneal Boundaries Extraction with U-Net

Notifications You must be signed in to change notification settings

zengyu714/corneal-gui

Repository files navigation

Corneal Boundaries Extraction with U-Net

  • This project works on extracting corneal boundaries with deep learning, precisely, based on the U-Net networks.
  • Better usability thanks to the handsome web GUI.
  • Accelerated by GPU (CUDA).

usage-demo

Getting Started

Prerequisites

Installing

  1. Clone this repository

    Note: Currently only support Python 3+

    cd /path/to/anywhere/you/like
    git clone https://github.com/zengyu714/corneal-gui
  2. Download the pre-trained weights

    cd corneal-gui/unet
    wget -c --referer=https://pan.baidu.com/s/1qYn3JbQ -O corneal-weights.zip "https://www.baidupcs.com/rest/2.0/pcs/file?method=batchdownload&app_id=250528&zipcontent=%7B%22fs_id%22%3A%5B%22747895932828831%22%5D%7D&sign=DCb740ccc5511e5e8fedcff06b081203:ZFmUVd4WUFSnu7qfoVgD0wczdaY%3D&uid=2265930192&time=1513187178&dp-logid=8026429103670053409&dp-callid=0&vuk=2265930192&from_uk=2265930192"
    unzip corneal-weights.zip 
    mv corneal-gui-weights weights
    rm -rf corneal-*
  3. Install requirements

    # may activate your virtual environment first
    sudo pip install -r /path/to/corneal-gui/requirements.txt
  4. Fire the web server

    cd /path/to/corneal-gui
    python gui.py runserver
    
    # or specify the host and port, default is http://localhost:5001
    # python gui.py runserver --host X.X.X.X -p XXXX
  5. Navigate to http://localhost:5001 and you would see:

    Homepage

Running the demo

  1. When you see the videos listed in the Repository, click the button Run all.

    Note: Make sure the button is actually responseded by checking the browser status:

    processing

  2. Wait a minute (around 8 seconds for a video consisting 139 frames). Alternatively, you could watch the detailed process in the console.

    TODO: display the console output in a real-time way, maybe Response.

    Anyway, the page would show the output and errors (if any) in the end:

    final_output

  3. Then click and select the video you want to inspect, this checked video name would be shown in the Checked panel:

    checked

  4. Click Inspect button and a new tab would be opened:

    inspect

Inspection

  • Biomechanical Parameters

    bioparams

    Further explanation of these parameters could be found here.

  • Charts

    1. line chart: curvature and thickness of the central corneal area through the whole video.

      line_chart

    2. 3D scatter: depicts the upper corneal surface.

      3d_scatter

    Thanks to the WONDERFUL ECharts, we could manipulate these drawings, say, zoom-in/out, view original data, save figures by toolbox:

    toolbox_fig.

  • Videos

    videos

    videos_mid

    Quickly inspect the detecting result.

  • Frames

    frames

Tips

  • Upload file limit is 12 files or 200MB

  • BETTER to Refresh the page after uploading

  • Clear the Repository after inspection

    refresh_clear

  • Use browser search (^ + F) when tend to locate a specific frame promptly

    search

Built With

Authors

License

This project is licensed under the Apache License

Acknowledgments

  • If you want to train the dataset from the beginning, see this repository.
  • Recommend Anaconda to create envs and manage python packages.
  • I am verrrrry excited to release my first true, complete project. 😘 😘