Skip to content

sfu-cmpt340/project_09

Repository files navigation

SFU CMPT 340 - SAM Segmentation Machine (SAM SM)

SAM Segmentation Machine is a full stack web application created by Mathew Tse, Raymond Kong, Alex Simpson, Jody Tao, Oliver Ng-Young-Lim. This web app allows users to upload a DICOM image and the segmented image will be returned in the 'processed images' page.

Important Links

Timesheet Slack channel Project report

Video/demo/GIF

Link to the Demo Video on YouTube:

https://youtu.be/l7nAdkC-3Kc

Demo video can be downloaded through this link (expires Dec 12): https://wetransfer.com/downloads/8c6c13ec6f487d89673af8de98a160ec20231206020832/9349e0

Table of Contents

  1. Demo

  2. Installation

  3. Reproducing this project

1. Example demo

A minimal example to showcase your work

Home Page with Lung Image Uploaded Screen Shot 2023-12-04 at 10 50 19 PM

Processed Segmented Images

Screen Shot 2023-12-04 at 10 52 03 PM

What to find where

File Directory Layout:

repository
├── functions                         ## Firebase credentials and cloud functions on file upload
├── my-react-app                     ## source code of React frontend 
├── SAM                        	## source code of SAM code and flask backend 
├── README.md                    ## You are here

2. Installation

SAM and backend setup

The code requires the following dependencies:

  1. Python version 3.9 - 3.11 (3.12 will not work!)
  2. Node.js (Make sure that you also have npm installed)

Clone the repository onto your computer

Download the file below by pasting this URL into your browser https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth Copy and paste this file into the project, inside of the SAM folder

SAM and backend Dependencies: CD into the SAM Directory and run

pip install -r requirements.txt

Frontend React setup

CD into the my-react-app directory and run npm install

Congratulations! You have finished installing the project! Run instructions are in the reproduction section below

3. Reproduction

On Windows:

  1. Open project_09 folder in your file explorer, and double click to run WindowsApp.bat
  2. Open your browser and go to the URL localhost:3000

Mac/Linux

  1. Open project_09 folder in your terminal, and type: sh MacOSApp.sh on Mac. Type sh Linux.sh on Linux.
  2. Open your browser and go to the URL localhost:3000

Alternatively, if the above didn't work:

  1. Open a new terminal
  2. cd into my-react-app
  3. npm run start -> React front end should now be running
  4. Open a new terminal
  5. cd into SAM
  6. python app.py -> Flask backend should now be running
  7. Wait until you see the message: Running on http://127.0.0.1:5000
  8. Open your browser and type in the URL: localhost:3000
  9. You should now be able to see the application running!
  10. To upload a file, click on the ‘Click Here to Upload a DICOM Image’ and select your DICOM image
  11. Once your DICOM images have been uploaded, wait up to 15 minutes for the segmented image to appear on the Modified Images tab.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6