diff --git a/docs/source/api_reference.rst b/docs/source/api_reference.rst index 01b7247..d103c14 100644 --- a/docs/source/api_reference.rst +++ b/docs/source/api_reference.rst @@ -3,39 +3,43 @@ API Reference .. toctree:: :caption: API Reference -.. autofunction:: segmenteverygrain.predict_image -.. autofunction:: segmenteverygrain.predict_large_image -.. autofunction:: segmenteverygrain.predict_image_tile -.. autofunction:: segmenteverygrain.label_grains -.. autofunction:: segmenteverygrain.one_point_prompt -.. autofunction:: segmenteverygrain.two_point_prompt -.. autofunction:: segmenteverygrain.find_overlapping_polygons -.. autofunction:: segmenteverygrain.weighted_crossentropy -.. autofunction:: segmenteverygrain.plot_images_and_labels .. autofunction:: segmenteverygrain.calculate_iou -.. autofunction:: segmenteverygrain.pick_most_similar_polygon -.. autofunction:: segmenteverygrain.sam_segmentation -.. autofunction:: segmenteverygrain.find_connected_components -.. autofunction:: segmenteverygrain.merge_overlapping_polygons -.. autofunction:: segmenteverygrain.rasterize_grains +.. autofunction:: segmenteverygrain.classify_points +.. autofunction:: segmenteverygrain.click_for_scale +.. autofunction:: segmenteverygrain.collect_polygon_from_mask +.. autofunction:: segmenteverygrain.compute_curvature +.. autofunction:: segmenteverygrain.convert_to_large_image_coords +.. autofunction:: segmenteverygrain.create_and_train_model .. autofunction:: segmenteverygrain.create_labeled_image +.. autofunction:: segmenteverygrain.create_train_val_test_data +.. autofunction:: segmenteverygrain.extract_patch +.. autofunction:: segmenteverygrain.find_connected_components +.. autofunction:: segmenteverygrain.find_grain_size_classes +.. autofunction:: segmenteverygrain.find_overlapping_polygons +.. autofunction:: segmenteverygrain.get_area_weighted_distribution +.. autofunction:: segmenteverygrain.get_grains_from_patches +.. autofunction:: segmenteverygrain.label_grains .. autofunction:: segmenteverygrain.load_and_preprocess +.. autofunction:: segmenteverygrain.merge_overlapping_polygons .. autofunction:: segmenteverygrain.onclick -.. autofunction:: segmenteverygrain.onpress .. autofunction:: segmenteverygrain.onclick2 -.. autofunction:: segmenteverygrain.onpress2 -.. autofunction:: segmenteverygrain.click_for_scale -.. autofunction:: segmenteverygrain.get_grains_from_patches -.. autofunction:: segmenteverygrain.plot_image_w_colorful_grains -.. autofunction:: segmenteverygrain.plot_grain_axes_and_centroids -.. autofunction:: segmenteverygrain.classify_points -.. autofunction:: segmenteverygrain.compute_curvature -.. autofunction:: segmenteverygrain.extract_patch -.. autofunction:: segmenteverygrain.convert_to_large_image_coords .. autofunction:: segmenteverygrain.onclick_large_image +.. autofunction:: segmenteverygrain.one_point_prompt +.. autofunction:: segmenteverygrain.onpress +.. autofunction:: segmenteverygrain.onpress2 .. autofunction:: segmenteverygrain.patchify_training_data -.. autofunction:: segmenteverygrain.create_train_val_test_data -.. autofunction:: segmenteverygrain.create_and_train_model -.. autofunction:: segmenteverygrain.save_polygons +.. autofunction:: segmenteverygrain.pick_most_similar_polygon +.. autofunction:: segmenteverygrain.plot_grain_axes_and_centroids +.. autofunction:: segmenteverygrain.plot_histogram_of_axis_lengths +.. autofunction:: segmenteverygrain.plot_image_w_colorful_grains +.. autofunction:: segmenteverygrain.plot_images_and_labels +.. autofunction:: segmenteverygrain.predict_image +.. autofunction:: segmenteverygrain.predict_image_tile +.. autofunction:: segmenteverygrain.predict_large_image +.. autofunction:: segmenteverygrain.rasterize_grains .. autofunction:: segmenteverygrain.read_polygons -.. autofunction:: segmenteverygrain.plot_histogram_of_axis_lengths \ No newline at end of file +.. autofunction:: segmenteverygrain.sam_segmentation +.. autofunction:: segmenteverygrain.save_polygons +.. autofunction:: segmenteverygrain.two_point_prompt +.. autofunction:: segmenteverygrain.Unet +.. autofunction:: segmenteverygrain.weighted_crossentropy \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 2024f57..28a148e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,7 +14,7 @@ project = 'segmenteverygrain' copyright = '2024, Zoltan Sylvester' author = 'Zoltan Sylvester' -release = '0.1.9' +release = '0.2.1' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/segmenteverygrain/Segment_every_grain_colab.ipynb b/segmenteverygrain/Segment_every_grain_colab.ipynb index 24180be..19f0fcc 100644 --- a/segmenteverygrain/Segment_every_grain_colab.ipynb +++ b/segmenteverygrain/Segment_every_grain_colab.ipynb @@ -794,7 +794,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.15" + "version": "3.8.20" }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/segmenteverygrain/Segment_every_grain_w_georeferencing.ipynb b/segmenteverygrain/Segment_every_grain_w_georeferencing.ipynb index d7239a0..9380cd5 100644 --- a/segmenteverygrain/Segment_every_grain_w_georeferencing.ipynb +++ b/segmenteverygrain/Segment_every_grain_w_georeferencing.ipynb @@ -80,7 +80,6 @@ "cell_type": "markdown", "id": "a3c1dfc6", "metadata": { - "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ @@ -127,7 +126,6 @@ "cell_type": "markdown", "id": "968737c4", "metadata": { - "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ @@ -225,7 +223,6 @@ "cell_type": "markdown", "id": "ab7201a5", "metadata": { - "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ @@ -316,7 +313,6 @@ "cell_type": "markdown", "id": "768a05d2", "metadata": { - "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ @@ -592,7 +588,6 @@ "cell_type": "markdown", "id": "039415c6", "metadata": { - "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ @@ -628,7 +623,6 @@ "cell_type": "markdown", "id": "24f154fb", "metadata": { - "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ @@ -1071,7 +1065,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.15" + "version": "3.8.20" } }, "nbformat": 4, diff --git a/segmenteverygrain/segmenteverygrain.py b/segmenteverygrain/segmenteverygrain.py index 32a1aa8..fa81b7b 100644 --- a/segmenteverygrain/segmenteverygrain.py +++ b/segmenteverygrain/segmenteverygrain.py @@ -415,7 +415,6 @@ def Unet(): tf.keras.backend.clear_session() - # image = tf.keras.Input((256, 256, 3), name='input') inputs = Input((256, 256, 3), name='input') conv1 = Conv2D(16, (3,3), activation='relu', padding = 'same')(inputs) @@ -1565,7 +1564,7 @@ def patchify_training_data(input_dir, patch_dir): start_no = 0 for image in tqdm(images): # Load the large image - large_image = tf.keras.preprocessing.image.load_img(image) + large_image = load_img(image) # Convert the image to a tensor large_image = tf.keras.preprocessing.image.img_to_array(large_image) # Reshape the tensor to have a batch size of 1 @@ -1591,7 +1590,7 @@ def patchify_training_data(input_dir, patch_dir): start_no = 0 for image in tqdm(labels): # Load the large image - large_image = tf.keras.preprocessing.image.load_img(image) + large_image = load_img(image) # Convert the image to a tensor large_image = tf.keras.preprocessing.image.img_to_array(large_image) large_image = large_image[:,:,0,np.newaxis] # only keep one layer and add a new axis diff --git a/setup.py b/setup.py index 0f355ad..40ce989 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name="segmenteverygrain", - version="0.2.0", + version="0.2.1", author="Zoltan Sylvester", author_email="zoltan.sylvester@beg.utexas.edu", description="a SAM-based model for segmenting grains in images of grains",