Skip to content

Conversation

@Fl4m3Ph03n1x
Copy link
Contributor

No description provided.

@Fl4m3Ph03n1x Fl4m3Ph03n1x added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 21, 2022
@Fl4m3Ph03n1x Fl4m3Ph03n1x self-assigned this Apr 21, 2022
Copy link
Member

@andreaazzini andreaazzini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, couple comments

target: torch.Tensor = self.get_target(index)
return target["category_id"]

def measure_weights(self, **kwargs) -> np.ndarray:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we run a test, just to make sure that calling measure_weights with no kwargs is valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would I run a test for that? (I don;t know enough to know how to use this :S )

@Fl4m3Ph03n1x
Copy link
Contributor Author

On a side note, I would like to point out:

platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/pedro/Workplace/v7/darwin-py
plugins: Faker-8.10.1, requests-mock-1.9.3, describe-1.0.0, anyio-2.2.0
collected 197 items                                                                                                                                                                                               

tests/darwin/cli_functions_test.py ...........                                                                                                                                                              [  5%]
tests/darwin/client_test.py ............                                                                                                                                                                    [ 11%]
tests/darwin/datatypes_test.py ....                                                                                                                                                                         [ 13%]
tests/darwin/item_sorter_test.py .......                                                                                                                                                                    [ 17%]
tests/darwin/path_utils_test.py ..                                                                                                                                                                          [ 18%]
tests/darwin/utils_test.py ...................                                                                                                                                                              [ 27%]
tests/darwin/dataset/dataset_utils_test.py ........                                                                                                                                                         [ 31%]
tests/darwin/dataset/identifier_test.py ...........                                                                                                                                                         [ 37%]
tests/darwin/dataset/local_dataset_test.py ....                                                                                                                                                             [ 39%]
tests/darwin/dataset/release_test.py .                                                                                                                                                                      [ 40%]
tests/darwin/dataset/remote_dataset_test.py .......................                                                                                                                                         [ 51%]
tests/darwin/dataset/split_manager_test.py ........                                                                                                                                                         [ 55%]
tests/darwin/dataset/upload_manager_test.py ........                                                                                                                                                        [ 59%]
tests/darwin/exporter/formats/export_coco_test.py ..                                                                                                                                                        [ 60%]
tests/darwin/exporter/formats/export_darwin_test.py ..                                                                                                                                                      [ 61%]
tests/darwin/exporter/formats/export_pascalvoc_test.py ....                                                                                                                                                 [ 63%]
tests/darwin/importer/formats/import_labelbox_test.py ......................                                                                                                                                [ 75%]
tests/darwin/importer/formats/import_pascalvoc_test.py ..............                                                                                                                                       [ 82%]
tests/darwin/importer/formats/import_superannotate_test.py .........................                                                                                                                        [ 94%]
tests/darwin/torch/dataset_test.py ..........                                                                                                                                                               [100%]

================================================================================================ warnings summary =================================================================================================
tests/darwin/dataset/remote_dataset_test.py::describe_pull::it_gets_latest_release_when_not_given_one
tests/darwin/dataset/remote_dataset_test.py::describe_pull::it_does_not_create_symlink_on_windows
tests/darwin/dataset/remote_dataset_test.py::describe_pull::it_continues_if_symlink_creation_fails
  /home/pedro/Workplace/v7/darwin-py/darwin/dataset/remote_dataset.py:362: DeprecatedWarning: download_all_images_from_annotations is deprecated as of 0.7.5 and will be removed in 0.8.0. The api_url parameter will be removed.
    progress, count = download_all_images_from_annotations(

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
  /home/pedro/Workplace/v7/darwin-py/tests/darwin/exporter/formats/export_pascalvoc_test.py:67: DeprecatedWarning: build_xml is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    xml = build_xml(annotation_file)

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:57: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(root, "folder", "images")

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:58: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(root, "filename", annotation_file.filename)

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:59: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(root, "path", f"images/{annotation_file.filename}")

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:62: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(source, "database", "darwin")

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:65: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(size, "width", str(annotation_file.image_width))

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:66: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(size, "height", str(annotation_file.image_height))

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:67: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(size, "depth", "3")

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:69: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(root, "segmented", "0")

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:78: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(sub_annotation, "name", annotation.annotation_class.name)

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:79: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(sub_annotation, "pose", "Unspecified")

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:80: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(sub_annotation, "truncated", "0")

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:81: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(sub_annotation, "difficult", "0")

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:91: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(bndbox, "xmin", str(round(xmin)))

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:92: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(bndbox, "ymin", str(round(ymin)))

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:93: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(bndbox, "xmax", str(round(xmax)))

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/darwin/exporter/formats/pascalvoc.py:94: DeprecatedWarning: add_subelement_text is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    add_subelement_text(bndbox, "ymax", str(round(ymax)))

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes_of_complex_polygons
  /home/pedro/Workplace/v7/darwin-py/tests/darwin/exporter/formats/export_pascalvoc_test.py:102: DeprecatedWarning: build_xml is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    xml = build_xml(annotation_file)

tests/darwin/exporter/formats/export_pascalvoc_test.py::describe_build_xml::test_xml_has_bounding_boxes
  /home/pedro/Workplace/v7/darwin-py/tests/darwin/exporter/formats/export_pascalvoc_test.py:134: DeprecatedWarning: build_xml is deprecated as of 0.7.10 and will be removed in 0.8.0. This function is going to be turned into private. This means that breaking 
  changes in its interface and implementation are to be expected. We encourage using ``export`` 
  instead of calling this low-level function directly.
    xml = build_xml(annotation_file)

-- Docs: https://docs.pytest.org/en/stable/warnings.html

By now, more than half of the screen are warnings about deprecated functions.
I would personally like to deprecate them finally.

Maybe next release can be 0.8.0?
(We have been warning people for long enough now and its not like we are using semantic versioning anyway)

Copy link
Member

@andreaazzini andreaazzini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good, I'm checking if any of our official integrations use measure_weights by sending any additional kwargs, once I complete the check we can merge to master

Copy link
Member

@andreaazzini andreaazzini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, blocking: tests not passing on Windows?

@Fl4m3Ph03n1x
Copy link
Contributor Author

We cannot use import numpy.typing as npt as numpy.typing was introduced in numpy 1.20.
To quote the docs at Numpy 1.20:

Python versions supported for this release are 3.7-3.9, support for Python 3.6 has been dropped.

https://numpy.org/doc/stable/release/1.20.0-notes.html

Yet another reason to drop Python 3.6.
Reverting changes.

@Fl4m3Ph03n1x Fl4m3Ph03n1x merged commit 7bb8011 into master Apr 25, 2022
@Fl4m3Ph03n1x Fl4m3Ph03n1x deleted the v7-2260-darwintorchdatasetpy branch April 25, 2022 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants