Skip to content

Commit

Permalink
minor tweaks to jupyter notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
zsylvester committed Nov 21, 2024
1 parent dcca423 commit 0f6b227
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions segmenteverygrain/Segment_every_grain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import cv2\n",
"from skimage import measure\n",
"from skimage.measure import regionprops, regionprops_table\n",
"from keras.optimizers import Adam\n",
"from keras.utils import load_img\n",
"from keras.saving import load_model\n",
"from importlib import reload\n",
"import segmenteverygrain as seg\n",
"from segment_anything import sam_model_registry, SamAutomaticMaskGenerator, SamPredictor\n",
"from segment_anything import sam_model_registry, SamPredictor\n",
"from tqdm import trange, tqdm\n",
"%matplotlib qt"
]
Expand Down Expand Up @@ -1210,7 +1208,7 @@
"metadata": {},
"outputs": [],
"source": [
"# save finetuned model as new model (this then can be loaded using \"model.load_weights('./new_model/seg_model')\"\n",
"# save finetuned model as new model (this then can be loaded using \"model = load_model(\"new_model.keras\", custom_objects={'weighted_crossentropy': seg.weighted_crossentropy})\"\n",
"model.save('new_model.keras')"
]
}
Expand Down

0 comments on commit 0f6b227

Please sign in to comment.