kaveh commited on
Commit
eb6972c
Β·
1 Parent(s): 71ba3f8

updated docker to include sample images

Browse files
README.md CHANGED
@@ -32,7 +32,7 @@ cd S2FApp && streamlit run app.py
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 `sample/`
36
  5. Click **Run prediction**
37
 
38
  Output: heatmap, cell force (sum), and basic stats.
 
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.
S2FApp/Dockerfile CHANGED
@@ -24,7 +24,8 @@ COPY --chown=user:user app.py predictor.py download_ckp.py ./
24
  COPY --chown=user:user models/ models/
25
  COPY --chown=user:user utils/ utils/
26
  COPY --chown=user:user config/ config/
27
- RUN mkdir -p ckp sample && chown -R user:user ckp sample
 
28
 
29
  # Download checkpoints from Hugging Face if ckp is empty (for Space deployment)
30
  # Requires HF_TOKEN secret in Space Settings (https://huggingface.co/settings/tokens)
 
24
  COPY --chown=user:user models/ models/
25
  COPY --chown=user:user utils/ utils/
26
  COPY --chown=user:user config/ config/
27
+ COPY --chown=user:user samples/ samples/
28
+ RUN mkdir -p ckp && chown user:user ckp
29
 
30
  # Download checkpoints from Hugging Face if ckp is empty (for Space deployment)
31
  # Requires HF_TOKEN secret in Space Settings (https://huggingface.co/settings/tokens)
S2FApp/README.md CHANGED
@@ -27,7 +27,7 @@ Checkpoints are downloaded automatically from the [Shape2Force model repo](https
27
  1. Choose **Model type**: Single cell or Spheroid
28
  2. Select a **Checkpoint** from `ckp/`
29
  3. For single-cell: pick **Substrate** (e.g. fibroblasts_PDMS)
30
- 4. Upload an image or pick from `sample/`
31
  5. Click **Run prediction**
32
 
33
  Output: heatmap, cell force (sum), and basic stats.
 
27
  1. Choose **Model type**: Single cell or Spheroid
28
  2. Select a **Checkpoint** from `ckp/`
29
  3. For single-cell: pick **Substrate** (e.g. fibroblasts_PDMS)
30
+ 4. Upload an image or pick from `samples/`
31
  5. Click **Run prediction**
32
 
33
  Output: heatmap, cell force (sum), and basic stats.
S2FApp/app.py CHANGED
@@ -31,7 +31,7 @@ st.caption("Predict force maps from bright field microscopy images")
31
 
32
  # Folders
33
  ckp_folder = os.path.join(S2F_ROOT, "ckp")
34
- sample_folder = os.path.join(S2F_ROOT, "sample")
35
  ckp_files = []
36
  if os.path.isdir(ckp_folder):
37
  ckp_files = sorted([f for f in os.listdir(ckp_folder) if f.endswith(".pth")])
@@ -120,7 +120,7 @@ else:
120
  sample_path = os.path.join(sample_folder, selected_sample)
121
  img = cv2.imread(sample_path, cv2.IMREAD_GRAYSCALE)
122
  # Show sample thumbnails
123
- st.caption("Sample images (add more to the `sample/` folder)")
124
  n_cols = min(4, len(sample_files))
125
  cols = st.columns(n_cols)
126
  for i, fname in enumerate(sample_files[:8]): # show up to 8
@@ -130,7 +130,7 @@ else:
130
  if sample_img is not None:
131
  st.image(sample_img, caption=fname, width='content')
132
  else:
133
- st.info("No sample images found. Add images to the `sample/` folder, or use Upload.")
134
 
135
  run = st.button("Run prediction", type="primary")
136
  has_image = img is not None
@@ -202,4 +202,4 @@ elif run and not has_image:
202
 
203
  # Footer
204
  st.sidebar.divider()
205
- st.sidebar.caption("Place .pth checkpoints in the ckp/ folder")
 
31
 
32
  # Folders
33
  ckp_folder = os.path.join(S2F_ROOT, "ckp")
34
+ sample_folder = os.path.join(S2F_ROOT, "samples")
35
  ckp_files = []
36
  if os.path.isdir(ckp_folder):
37
  ckp_files = sorted([f for f in os.listdir(ckp_folder) if f.endswith(".pth")])
 
120
  sample_path = os.path.join(sample_folder, selected_sample)
121
  img = cv2.imread(sample_path, cv2.IMREAD_GRAYSCALE)
122
  # Show sample thumbnails
123
+ st.caption("Sample images (add more to the `samples/` folder)")
124
  n_cols = min(4, len(sample_files))
125
  cols = st.columns(n_cols)
126
  for i, fname in enumerate(sample_files[:8]): # show up to 8
 
130
  if sample_img is not None:
131
  st.image(sample_img, caption=fname, width='content')
132
  else:
133
+ st.info("No sample images found. Add images to the `samples/` folder, or use Upload.")
134
 
135
  run = st.button("Run prediction", type="primary")
136
  has_image = img is not None
 
202
 
203
  # Footer
204
  st.sidebar.divider()
205
+ st.sidebar.caption("Place .pth checkpoints in ckp/, sample images in samples/")
S2FApp/{sample β†’ samples}/.gitkeep RENAMED
File without changes
S2FApp/{sample β†’ samples}/BF_10KPa.tif RENAMED
File without changes
S2FApp/{sample β†’ samples}/BF_Control.tif RENAMED
File without changes
S2FApp/{sample β†’ samples}/BF_Fibro.tif RENAMED
File without changes
S2FApp/{sample β†’ samples}/BF_Fibronectin.tif RENAMED
File without changes
S2FApp/{sample β†’ samples}/BF_Spheroid.tif RENAMED
File without changes