Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
7cf5bee
Added the new vision code.
SimoneMartino98 Jun 27, 2025
49a6334
deleted old vision code.
SimoneMartino98 Jun 27, 2025
dab882d
Update documentation.
SimoneMartino98 Jun 27, 2025
020f3ba
Removed useless imports.
SimoneMartino98 Jun 27, 2025
1656ab2
Exporting optimization dictionary.
SimoneMartino98 Jun 30, 2025
2c079b4
Added device checker (WIP).
SimoneMartino98 Jun 30, 2025
ce424cf
Added imgsz to the tuning function.
SimoneMartino98 Jun 30, 2025
fb1a07a
Added first version of doc for tuning (WIP).
SimoneMartino98 Jun 30, 2025
1e1d612
Optimized the documentation and modified the output shape for tuning.
SimoneMartino98 Jun 30, 2025
95d0bd0
Fixed formatting.
SimoneMartino98 Jun 30, 2025
879331a
Added batch_size to tuning.
SimoneMartino98 Jun 30, 2025
62a17cf
Added label tool server.
SimoneMartino98 Jul 2, 2025
0f88734
Added guidelines.
SimoneMartino98 Jul 2, 2025
7beda95
Fixing label positions.
SimoneMartino98 Jul 2, 2025
8a3ed55
Formatting code.
SimoneMartino98 Jul 4, 2025
58c6108
Added create dataset from predictions method.
SimoneMartino98 Jul 7, 2025
24ca570
Added xyz export method.
SimoneMartino98 Jul 7, 2025
c046f63
Added path return to export xyz.
SimoneMartino98 Jul 7, 2025
90ac650
Added track module.
SimoneMartino98 Jul 7, 2025
7fbd6c2
Added zoom in and zoom out in the label_tool.
SimoneMartino98 Jul 8, 2025
1e31e4f
Image size fixs.
SimoneMartino98 Jul 8, 2025
8186f76
Zoom fixs.
SimoneMartino98 Jul 8, 2025
5bda1aa
Fixing red guidelines.
SimoneMartino98 Jul 8, 2025
2d58ba8
Image stretch bug fix.
SimoneMartino98 Jul 8, 2025
04dc846
Fixing bounding box positions rules.
SimoneMartino98 Jul 8, 2025
f681078
Fixing server shutdown.
SimoneMartino98 Jul 9, 2025
763936d
Added vision tests.
SimoneMartino98 Jul 9, 2025
913bc5a
Removed tests.
SimoneMartino98 Jul 9, 2025
db66c5c
Adding vision test.
SimoneMartino98 Jul 10, 2025
63c72d5
adding dependecies.
SimoneMartino98 Jul 10, 2025
f8010cb
added test for track.
SimoneMartino98 Jul 11, 2025
a3c5194
Added synthesize dataset button to the label tool.
SimoneMartino98 Jul 21, 2025
b961d6d
Make the label tool executable standalone.
SimoneMartino98 Jul 21, 2025
2b4d316
Fixing bug for video source dataset creation.
SimoneMartino98 Jul 23, 2025
c60cc67
ruff fixes.
SimoneMartino98 Jul 23, 2025
629ea8c
Added example code WIP.
SimoneMartino98 Jul 24, 2025
afc708a
Added extraction to xyz and tracked xyz in example script.
SimoneMartino98 Jul 28, 2025
3af2528
Added dependencies.
SimoneMartino98 Jul 28, 2025
4caaec9
Added a custom css file to modify the documentation layout.
SimoneMartino98 Jul 29, 2025
a878df4
Vision doc updated.
SimoneMartino98 Jul 29, 2025
0c4a54c
Remove ultralytics manual dependency and add the label tool
SimoneMartino98 Jul 29, 2025
052f368
Minor fixes.
SimoneMartino98 Jul 29, 2025
f7de55b
Solving dataset exportation bug and minor fixes.
SimoneMartino98 Jul 29, 2025
ba805b2
Merge branch 'main' into new_vision
SimoneMartino98 Jul 29, 2025
35247e3
removed noqa.
SimoneMartino98 Jul 29, 2025
83a3312
removed tica.
SimoneMartino98 Jul 29, 2025
f2c5e14
TEMPORARY - removed 3.13 tests from workflow.
SimoneMartino98 Jul 29, 2025
e17ba6a
Documentation minor fixes.
SimoneMartino98 Jul 30, 2025
acf343f
vision module title.
SimoneMartino98 Jul 30, 2025
1919aea
Class documentation fix.
SimoneMartino98 Jul 30, 2025
7ea833d
Fixing docs errors
SimoneMartino98 Aug 21, 2025
52d71a2
Fixing dependencies.
SimoneMartino98 Aug 21, 2025
edb89a7
class names now display in the xyz file.
SimoneMartino98 Aug 21, 2025
d4bfb20
Fixing dependencies.
SimoneMartino98 Aug 21, 2025
8c8ea4c
fixing union attribute error.
SimoneMartino98 Aug 21, 2025
996b1ef
Fixed docs out of the screen bug.
SimoneMartino98 Aug 21, 2025
602342b
added the name among the xyz file cols.
SimoneMartino98 Aug 25, 2025
0474155
Fixing test track.
SimoneMartino98 Aug 25, 2025
415c6ab
Fomratting and type fixing.
SimoneMartino98 Aug 25, 2025
428ed1f
Added new read_xyz function and minor fixes.
SimoneMartino98 Aug 26, 2025
71fb2d3
Fix typing error..
SimoneMartino98 Aug 26, 2025
29f47ce
Fixing toc width.
SimoneMartino98 Aug 26, 2025
2b0046b
Removing noqa.
SimoneMartino98 Aug 26, 2025
46714e8
Added docstring to read_xyz.
SimoneMartino98 Aug 26, 2025
06bc6df
Added python 3.13 tests version.
SimoneMartino98 Aug 27, 2025
a843099
removed type from doc.
SimoneMartino98 Aug 27, 2025
4c8ecd9
Removed default value for search_range.
SimoneMartino98 Aug 27, 2025
8f9777f
minor fixes.
SimoneMartino98 Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 75 additions & 75 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
name: Tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
ruff:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
name: ruff on ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install -e '.[dev]'
- run: ruff check .
mypy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
name: mypy on ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install -e '.[dev]'
- run: mypy .
ruff-format:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
name: ruff-format on ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install -e '.[dev]'
- run: ruff format --check .
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
name: pytest on ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install -e '.[dev]'
- run: pytest --cov=src --cov-report term-missing
doctest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
name: doctest on ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install -e '.[dev]'
- run: make -C docs doctest
ruff:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
name: ruff on ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install -e '.[dev]'
- run: ruff check .
mypy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
name: mypy on ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install -e '.[dev]'
- run: mypy .
ruff-format:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
name: ruff-format on ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install -e '.[dev]'
- run: ruff format --check .
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
name: pytest on ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install -e '.[dev]'
- run: pytest --cov=src --cov-report term-missing
doctest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
name: doctest on ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install -e '.[dev]'
- run: make -C docs doctest
Binary file added docs/source/_static/label_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/label_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/label_tool.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions docs/source/_static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*DOCS SIDEBARS AND CENTERING*/
.sidebar-drawer,
.sidebar-container,
.toc-drawer {
width: 15em;
min-width: 15em;
}
@media (min-width: 65em) {
.content {
margin-left: auto;
margin-right: auto;
}
}
@media (min-width: 82em) {
.page {
justify-content: center;
}
.toc-drawer {
position: fixed;
right: 0;
top: 0;
}
}
11 changes: 10 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
from __future__ import annotations

import importlib
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from sphinx.application import Sphinx

project = "dynsight"
project_copyright = "2023, Andrew Tarzia"
Expand Down Expand Up @@ -37,7 +41,7 @@

autodoc_typehints = "description"
autodoc_member_order = "groupwise"
autoclass_content = "class"
autoclass_content = "both"

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
Expand All @@ -53,3 +57,8 @@

html_theme = "furo"
html_static_path = ["_static"]


def setup(app: Sphinx) -> None:
"""Configure the Sphinx app by adding a custom CSS file."""
app.add_css_file("style.css")
5 changes: 1 addition & 4 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:maxdepth: 2

vision <vision>
track <track>
descriptors <descriptors>
onion clustering <onion>
analysis <analysis>
Expand Down Expand Up @@ -75,10 +76,6 @@ you are using Python 3.10 and below, you can use :mod:`cpctools` to access

$ pip install cpctools

If you want to use the :mod:`dynsight.vision` and :mod:`dynsight.track` modules
you will need to install a series of packages. This can be done with with pip::

$ pip install ultralytics PyYAML

How to get started
------------------
Expand Down
70 changes: 70 additions & 0 deletions docs/source/label_tool/label_tool.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
The Label Tool
==============

The ``dynsight label_tool`` is a simple web application that allows users to
label images. Picture labelling is a crucial step in many computer vision tasks,
such as the creation of initial training dataset to train Convolutional Neural
Networks (CNNs) model. The current version of `dynsight vision <../_autosummary/dynsight.vision.VisionInstance.html>`_
exploits the power of the `YOLO models <https://docs.ultralytics.com/models/yolo12/>`_
for computer vision tasks. Thus, the ``label_tool`` has been specifically
designed to work with the YOLO dataset format.

.. image:: ../_static/label_tool.png

----------
How to Use
----------

The ``label_tool`` application can be executed in 2 main ways:

* As a standalone application, run the following command in the environment
where dynsight is installed:

.. code-block:: bash

$ label_tool

* From python code:

.. code-block:: python

import dynsight

dynsight.vision.label_tool(port=8888) #port selection is optional
Comment thread
andrewtarzia marked this conversation as resolved.

In both cases a localhost server should start and the application should
automatically appear in your default web browser.

.. tip::

In case the application does
not open automatically, you can manually open it by copying and pasting
the URL provided in the terminal output.

-------
The GUI
-------

The ``label_tool`` Graphical User Interface is divided in three main panels:
Comment thread
andrewtarzia marked this conversation as resolved.

* **The image panel**: where loaded images appear and labels can be drawn.

* **The label menu panel**: where labels can be created and edited.

.. image:: ../_static/label_menu.png
:align: center

* **The commands panel**: where all the available commands can be executed.

.. image:: ../_static/label_bar.png

Using the ``Choose File`` button, users can select the image(s) they want to
label. Once the image is loaded, users can start drawing labels by clicking and
dragging on the image panel. The label menu panel allows users to create and
edit labels. Finally, the commands panel provides a set of exporting options:

* **Export label**: Download a single ``.txt`` file in YOLO format containing the labels for the current image.

* **Export dataset**: Download a YOLO dataset from the loaded images with the labels and create the initial yaml configuration file to be used in the YOLO training process.

* **Synthesize dataset**: Create a synthetic dataset from the drawn labels randomizing the object position in different images (useful when a low number of images is available).
14 changes: 14 additions & 0 deletions docs/source/track.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
track
=====

This module tracks particle trajectories in `.xyz` files that lack explicit
particle IDs, assigning consistent identities across frames.
It is especially useful for outputs generated by the :doc:`vision` module.

Functions
---------

.. toctree::
:maxdepth: 1

track_xyz <_autosummary/dynsight.track.track_xyz>
4 changes: 2 additions & 2 deletions docs/source/vision.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Usage
.. toctree::
:maxdepth: 1

Video <_autosummary/dynsight.vision.Video.rst>
Detect <_autosummary/dynsight.vision.Detect.rst>
label_tool <label_tool/label_tool.rst>
VisionInstance <_autosummary/dynsight.vision.VisionInstance.rst>
Loading