Skip to content

Commit 533c616

Browse files
committed
update docs and minor tweaks
1 parent 0f6b227 commit 533c616

File tree

6 files changed

+38
-41
lines changed

6 files changed

+38
-41
lines changed

docs/source/api_reference.rst

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,43 @@ API Reference
33
.. toctree::
44
:caption: API Reference
55

6-
.. autofunction:: segmenteverygrain.predict_image
7-
.. autofunction:: segmenteverygrain.predict_large_image
8-
.. autofunction:: segmenteverygrain.predict_image_tile
9-
.. autofunction:: segmenteverygrain.label_grains
10-
.. autofunction:: segmenteverygrain.one_point_prompt
11-
.. autofunction:: segmenteverygrain.two_point_prompt
12-
.. autofunction:: segmenteverygrain.find_overlapping_polygons
13-
.. autofunction:: segmenteverygrain.weighted_crossentropy
14-
.. autofunction:: segmenteverygrain.plot_images_and_labels
156
.. autofunction:: segmenteverygrain.calculate_iou
16-
.. autofunction:: segmenteverygrain.pick_most_similar_polygon
17-
.. autofunction:: segmenteverygrain.sam_segmentation
18-
.. autofunction:: segmenteverygrain.find_connected_components
19-
.. autofunction:: segmenteverygrain.merge_overlapping_polygons
20-
.. autofunction:: segmenteverygrain.rasterize_grains
7+
.. autofunction:: segmenteverygrain.classify_points
8+
.. autofunction:: segmenteverygrain.click_for_scale
9+
.. autofunction:: segmenteverygrain.collect_polygon_from_mask
10+
.. autofunction:: segmenteverygrain.compute_curvature
11+
.. autofunction:: segmenteverygrain.convert_to_large_image_coords
12+
.. autofunction:: segmenteverygrain.create_and_train_model
2113
.. autofunction:: segmenteverygrain.create_labeled_image
14+
.. autofunction:: segmenteverygrain.create_train_val_test_data
15+
.. autofunction:: segmenteverygrain.extract_patch
16+
.. autofunction:: segmenteverygrain.find_connected_components
17+
.. autofunction:: segmenteverygrain.find_grain_size_classes
18+
.. autofunction:: segmenteverygrain.find_overlapping_polygons
19+
.. autofunction:: segmenteverygrain.get_area_weighted_distribution
20+
.. autofunction:: segmenteverygrain.get_grains_from_patches
21+
.. autofunction:: segmenteverygrain.label_grains
2222
.. autofunction:: segmenteverygrain.load_and_preprocess
23+
.. autofunction:: segmenteverygrain.merge_overlapping_polygons
2324
.. autofunction:: segmenteverygrain.onclick
24-
.. autofunction:: segmenteverygrain.onpress
2525
.. autofunction:: segmenteverygrain.onclick2
26-
.. autofunction:: segmenteverygrain.onpress2
27-
.. autofunction:: segmenteverygrain.click_for_scale
28-
.. autofunction:: segmenteverygrain.get_grains_from_patches
29-
.. autofunction:: segmenteverygrain.plot_image_w_colorful_grains
30-
.. autofunction:: segmenteverygrain.plot_grain_axes_and_centroids
31-
.. autofunction:: segmenteverygrain.classify_points
32-
.. autofunction:: segmenteverygrain.compute_curvature
33-
.. autofunction:: segmenteverygrain.extract_patch
34-
.. autofunction:: segmenteverygrain.convert_to_large_image_coords
3526
.. autofunction:: segmenteverygrain.onclick_large_image
27+
.. autofunction:: segmenteverygrain.one_point_prompt
28+
.. autofunction:: segmenteverygrain.onpress
29+
.. autofunction:: segmenteverygrain.onpress2
3630
.. autofunction:: segmenteverygrain.patchify_training_data
37-
.. autofunction:: segmenteverygrain.create_train_val_test_data
38-
.. autofunction:: segmenteverygrain.create_and_train_model
39-
.. autofunction:: segmenteverygrain.save_polygons
31+
.. autofunction:: segmenteverygrain.pick_most_similar_polygon
32+
.. autofunction:: segmenteverygrain.plot_grain_axes_and_centroids
33+
.. autofunction:: segmenteverygrain.plot_histogram_of_axis_lengths
34+
.. autofunction:: segmenteverygrain.plot_image_w_colorful_grains
35+
.. autofunction:: segmenteverygrain.plot_images_and_labels
36+
.. autofunction:: segmenteverygrain.predict_image
37+
.. autofunction:: segmenteverygrain.predict_image_tile
38+
.. autofunction:: segmenteverygrain.predict_large_image
39+
.. autofunction:: segmenteverygrain.rasterize_grains
4040
.. autofunction:: segmenteverygrain.read_polygons
41-
.. autofunction:: segmenteverygrain.plot_histogram_of_axis_lengths
41+
.. autofunction:: segmenteverygrain.sam_segmentation
42+
.. autofunction:: segmenteverygrain.save_polygons
43+
.. autofunction:: segmenteverygrain.two_point_prompt
44+
.. autofunction:: segmenteverygrain.Unet
45+
.. autofunction:: segmenteverygrain.weighted_crossentropy

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
project = 'segmenteverygrain'
1515
copyright = '2024, Zoltan Sylvester'
1616
author = 'Zoltan Sylvester'
17-
release = '0.1.9'
17+
release = '0.2.1'
1818

1919
# -- General configuration ---------------------------------------------------
2020
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

segmenteverygrain/Segment_every_grain_colab.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@
794794
"name": "python",
795795
"nbconvert_exporter": "python",
796796
"pygments_lexer": "ipython3",
797-
"version": "3.8.15"
797+
"version": "3.8.20"
798798
},
799799
"widgets": {
800800
"application/vnd.jupyter.widget-state+json": {

segmenteverygrain/Segment_every_grain_w_georeferencing.ipynb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
"cell_type": "markdown",
8181
"id": "a3c1dfc6",
8282
"metadata": {
83-
"jp-MarkdownHeadingCollapsed": true,
8483
"tags": []
8584
},
8685
"source": [
@@ -127,7 +126,6 @@
127126
"cell_type": "markdown",
128127
"id": "968737c4",
129128
"metadata": {
130-
"jp-MarkdownHeadingCollapsed": true,
131129
"tags": []
132130
},
133131
"source": [
@@ -225,7 +223,6 @@
225223
"cell_type": "markdown",
226224
"id": "ab7201a5",
227225
"metadata": {
228-
"jp-MarkdownHeadingCollapsed": true,
229226
"tags": []
230227
},
231228
"source": [
@@ -316,7 +313,6 @@
316313
"cell_type": "markdown",
317314
"id": "768a05d2",
318315
"metadata": {
319-
"jp-MarkdownHeadingCollapsed": true,
320316
"tags": []
321317
},
322318
"source": [
@@ -592,7 +588,6 @@
592588
"cell_type": "markdown",
593589
"id": "039415c6",
594590
"metadata": {
595-
"jp-MarkdownHeadingCollapsed": true,
596591
"tags": []
597592
},
598593
"source": [
@@ -628,7 +623,6 @@
628623
"cell_type": "markdown",
629624
"id": "24f154fb",
630625
"metadata": {
631-
"jp-MarkdownHeadingCollapsed": true,
632626
"tags": []
633627
},
634628
"source": [
@@ -1071,7 +1065,7 @@
10711065
"name": "python",
10721066
"nbconvert_exporter": "python",
10731067
"pygments_lexer": "ipython3",
1074-
"version": "3.8.15"
1068+
"version": "3.8.20"
10751069
}
10761070
},
10771071
"nbformat": 4,

segmenteverygrain/segmenteverygrain.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ def Unet():
415415

416416
tf.keras.backend.clear_session()
417417

418-
# image = tf.keras.Input((256, 256, 3), name='input')
419418
inputs = Input((256, 256, 3), name='input')
420419

421420
conv1 = Conv2D(16, (3,3), activation='relu', padding = 'same')(inputs)
@@ -1565,7 +1564,7 @@ def patchify_training_data(input_dir, patch_dir):
15651564
start_no = 0
15661565
for image in tqdm(images):
15671566
# Load the large image
1568-
large_image = tf.keras.preprocessing.image.load_img(image)
1567+
large_image = load_img(image)
15691568
# Convert the image to a tensor
15701569
large_image = tf.keras.preprocessing.image.img_to_array(large_image)
15711570
# Reshape the tensor to have a batch size of 1
@@ -1591,7 +1590,7 @@ def patchify_training_data(input_dir, patch_dir):
15911590
start_no = 0
15921591
for image in tqdm(labels):
15931592
# Load the large image
1594-
large_image = tf.keras.preprocessing.image.load_img(image)
1593+
large_image = load_img(image)
15951594
# Convert the image to a tensor
15961595
large_image = tf.keras.preprocessing.image.img_to_array(large_image)
15971596
large_image = large_image[:,:,0,np.newaxis] # only keep one layer and add a new axis

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setuptools.setup(
1010
name="segmenteverygrain",
11-
version="0.2.0",
11+
version="0.2.1",
1212
author="Zoltan Sylvester",
1313
author_email="zoltan.sylvester@beg.utexas.edu",
1414
description="a SAM-based model for segmenting grains in images of grains",

0 commit comments

Comments
 (0)