updated readme
Browse files- README.md +18 -30
- S2FApp/app.py +1 -1
- notebooks/{evaluate_model.ipynb → demo.ipynb} +0 -0
README.md
CHANGED
|
@@ -1,55 +1,43 @@
|
|
| 1 |
# Shape2Force (S2F)
|
| 2 |
|
| 3 |
-
Predict force maps from bright-field microscopy images of single-cell or spheroid
|
| 4 |
-
|
| 5 |
-
**Web App:** The app is published to [Hugging Face Spaces](https://huggingface.co/spaces/kaveh/Shape2force). To work on it locally: `git clone git@hf.co:spaces/kaveh/Shape2force S2FApp`
|
| 6 |
|
| 7 |
---
|
| 8 |
|
| 9 |
-
##
|
| 10 |
|
| 11 |
-
|
|
|
|
| 12 |
```bash
|
| 13 |
-
|
|
|
|
| 14 |
pip install -r requirements.txt
|
| 15 |
streamlit run app.py
|
| 16 |
```
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
---
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
### 1. Web App
|
| 25 |
-
|
| 26 |
-
Run the Streamlit GUI from `S2FApp/`:
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
```
|
| 31 |
-
|
| 32 |
-
1. Choose **Model type**: Single cell or Spheroid
|
| 33 |
-
2. Select a **Checkpoint** from `ckp/`
|
| 34 |
-
3. For single-cell: pick **Substrate** (e.g. fibroblasts_PDMS)
|
| 35 |
-
4. Upload an image or pick from `samples/`
|
| 36 |
-
5. Click **Run prediction**
|
| 37 |
-
|
| 38 |
-
Output: heatmap, cell force (sum), and basic stats.
|
| 39 |
-
|
| 40 |
-
----
|
| 41 |
-
|
| 42 |
-
### 2. Jupyter Notebook
|
| 43 |
|
| 44 |
For interactive usage and custom analysis, you may use the notebook:
|
| 45 |
|
| 46 |
-
- **`notebooks/
|
| 47 |
|
| 48 |
Once cloned the repo. open the notebook in Jupyter and adjust the configuration cell (paths, model type, substrate).
|
| 49 |
|
| 50 |
---
|
| 51 |
|
| 52 |
-
###
|
| 53 |
|
| 54 |
**Dataset layout:** A folder with `train/` and `test/` subfolders. Each subfolder has:
|
| 55 |
- `BF_001.tif` (bright-field image)
|
|
|
|
| 1 |
# Shape2Force (S2F)
|
| 2 |
|
| 3 |
+
Predict force maps from bright-field microscopy images of single-cell or spheroid.
|
|
|
|
|
|
|
| 4 |
|
| 5 |
---
|
| 6 |
|
| 7 |
+
## Ways to Use S2F
|
| 8 |
|
| 9 |
+
### 1. Web App (local)
|
| 10 |
+
Run the Streamlit GUI from `S2FApp/`:
|
| 11 |
```bash
|
| 12 |
+
git clone https://github.com/Angione-Lab/Shape2Force.git
|
| 13 |
+
cd Shape2Force/S2FApp
|
| 14 |
pip install -r requirements.txt
|
| 15 |
streamlit run app.py
|
| 16 |
```
|
| 17 |
+
1. Choose Model type: Single cell or Spheroid
|
| 18 |
+
2. Place checkpoints (`.pth`) in `S2FApp/ckp/` for local use.
|
| 19 |
+
3. Select a Checkpoint from `ckp/`
|
| 20 |
+
4. For single-cell: pick Substrate (e.g. fibroblasts_PDMS)
|
| 21 |
+
5. Upload an image or pick from `samples/`
|
| 22 |
+
6. Click Run prediction
|
| 23 |
|
| 24 |
---
|
| 25 |
+
### 2. Web App Online
|
| 26 |
|
| 27 |
+
Use the [online app](https://huggingface.co/spaces/kaveh/Shape2force) on Hugging Face.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
---
|
| 30 |
+
### 3. Jupyter Notebook
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
For interactive usage and custom analysis, you may use the notebook:
|
| 33 |
|
| 34 |
+
- **`notebooks/demo.ipynb`** – Load data, run evaluation, plot predictions, and save per-sample metrics.
|
| 35 |
|
| 36 |
Once cloned the repo. open the notebook in Jupyter and adjust the configuration cell (paths, model type, substrate).
|
| 37 |
|
| 38 |
---
|
| 39 |
|
| 40 |
+
### 4. Training & Fine-Tuning
|
| 41 |
|
| 42 |
**Dataset layout:** A folder with `train/` and `test/` subfolders. Each subfolder has:
|
| 43 |
- `BF_001.tif` (bright-field image)
|
S2FApp/app.py
CHANGED
|
@@ -136,7 +136,7 @@ run = st.button("Run prediction", type="primary")
|
|
| 136 |
has_image = img is not None
|
| 137 |
|
| 138 |
if run and checkpoint and has_image:
|
| 139 |
-
st.markdown(f"**
|
| 140 |
with st.spinner("Loading model and predicting..."):
|
| 141 |
try:
|
| 142 |
from predictor import S2FPredictor
|
|
|
|
| 136 |
has_image = img is not None
|
| 137 |
|
| 138 |
if run and checkpoint and has_image:
|
| 139 |
+
st.markdown(f"**Using checkpoint:** `{checkpoint}`")
|
| 140 |
with st.spinner("Loading model and predicting..."):
|
| 141 |
try:
|
| 142 |
from predictor import S2FPredictor
|
notebooks/{evaluate_model.ipynb → demo.ipynb}
RENAMED
|
File without changes
|