.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_model_inference.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_model_inference.py: Model Inference =============== This example demonstrates how to detect structures with a CNN using ``discopat``. .. GENERATED FROM PYTHON SOURCE LINES 9-11 Imports ------- .. GENERATED FROM PYTHON SOURCE LINES 11-18 .. code-block:: Python from tqdm import tqdm from discopat.core import Movie from discopat.display import plot_frame from discopat.repositories import repository_factory from discopat.nn_models import FasterRCNNModel .. GENERATED FROM PYTHON SOURCE LINES 19-21 Definitions ----------- .. GENERATED FROM PYTHON SOURCE LINES 21-29 .. code-block:: Python movie_name = "blob_i/density" model_name = "faster_rcnn_241113_131447" computing_device = "cpu" data_source = "osf" framework = "torch" .. GENERATED FROM PYTHON SOURCE LINES 30-32 Load the images --------------- .. GENERATED FROM PYTHON SOURCE LINES 32-39 .. code-block:: Python movie_repository = repository_factory(data_source, "input_movies") movie = movie_repository.read(movie_name) for frame in movie.frames: plot_frame(frame) .. rst-class:: sphx-glr-script-out .. code-block:: none 0%| | 0.00/361 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_model_inference.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_model_inference.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_