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.
Timesheet | Slack channel | Project report |
---|
Link to the Demo Video on YouTube:
Demo video can be downloaded through this link (expires Dec 12): https://wetransfer.com/downloads/8c6c13ec6f487d89673af8de98a160ec20231206020832/9349e0
A minimal example to showcase your work
Home Page with Lung Image Uploaded
Processed Segmented Images

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
The code requires the following dependencies:
- Python version 3.9 - 3.11 (3.12 will not work!)
- 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
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
- Open project_09 folder in your file explorer, and double click to run WindowsApp.bat
- Open your browser and go to the URL localhost:3000
- Open project_09 folder in your terminal, and type: sh MacOSApp.sh on Mac. Type sh Linux.sh on Linux.
- Open your browser and go to the URL localhost:3000
- Open a new terminal
- cd into my-react-app
- npm run start -> React front end should now be running
- Open a new terminal
- cd into SAM
- python app.py -> Flask backend should now be running
- Wait until you see the message: Running on http://127.0.0.1:5000
- Open your browser and type in the URL: localhost:3000
- You should now be able to see the application running!
- To upload a file, click on the ‘Click Here to Upload a DICOM Image’ and select your DICOM image
- Once your DICOM images have been uploaded, wait up to 15 minutes for the segmented image to appear on the Modified Images tab.