Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync with upstream #80

Merged
merged 55 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
bb2dc41
syncing util/mask_tools.py
Eldies Feb 4, 2025
5919001
syncing util/image.py
Eldies Feb 5, 2025
e41a9d0
keeping exif unconditionally
Eldies Feb 5, 2025
43f53eb
syncing components/media.py
Eldies Feb 5, 2025
eb4288a
syncing components/importer.py
Eldies Feb 6, 2025
b3e9d87
syncing util/meta_file_util.py
Eldies Feb 6, 2025
af1c285
moving cli/contexts/project/diff.py to cli/util/compare.py
Eldies Feb 6, 2025
7089ba6
moving Registry and PluginRegistry to components/registry.py
Eldies Feb 6, 2025
ac4f89f
syncing components/exporter.py
Eldies Feb 6, 2025
b8b3b61
syncing components/hl_ops.py
Eldies Feb 7, 2025
5b191da
syncing components/dataset.py
Eldies Feb 7, 2025
4bae045
limiting opencv version (due to https://github.com/opencv/opencv/pull…
Eldies Feb 7, 2025
414d47a
fixes
Eldies Feb 7, 2025
240196f
upper case extension fix
Eldies Feb 7, 2025
df5d69d
fixes
Eldies Feb 7, 2025
80ba8ad
always keeping exif info
Eldies Feb 10, 2025
0952381
limiting opencv version
Eldies Feb 7, 2025
349edd0
Update src/datumaro/components/media.py
Eldies Feb 10, 2025
8183132
Merge branch 'dl/always-keeping-exif' into dl/sync-with-upstream
Eldies Feb 10, 2025
b3fcd83
test for reading exif orientation
Eldies Feb 10, 2025
bd3e621
changelog entry
Eldies Feb 10, 2025
ec9aeda
fixed isort
Eldies Feb 10, 2025
8baa233
Merge branch 'dl/always-keeping-exif' into dl/sync-with-upstream
Eldies Feb 10, 2025
5a08884
fixed test
Eldies Feb 10, 2025
ab794e7
fixed changelog
Eldies Feb 10, 2025
cc93fe9
Merge branch 'dl/always-keeping-exif' into dl/sync-with-upstream
Eldies Feb 10, 2025
1f82e88
Merge branch 'develop' into dl/sync-with-upstream
Eldies Feb 10, 2025
7730a51
Update src/datumaro/components/hl_ops/__init__.py
Eldies Feb 10, 2025
8d59db7
fixing filter examples
Eldies Feb 10, 2025
5dc0290
hl_ops tests
Eldies Feb 10, 2025
d27b0b5
Update src/datumaro/components/media.py
Eldies Feb 11, 2025
f71623b
Update src/datumaro/components/media.py
Eldies Feb 11, 2025
0dd0002
Update src/datumaro/components/media.py
Eldies Feb 11, 2025
9116607
Update tests/unit/test_video.py
Eldies Feb 11, 2025
2f74586
Update src/datumaro/components/registry.py
Eldies Feb 11, 2025
41a4a14
fixes
Eldies Feb 11, 2025
dc31a96
fix linters
Eldies Feb 11, 2025
6ae1bce
tests for HLOps.compare
Eldies Feb 11, 2025
d1b3036
syncing tests/unit/test_image.py
Eldies Feb 12, 2025
255f499
accounting for the new flag in cv2
Eldies Feb 12, 2025
50e8901
fixes
Eldies Feb 13, 2025
38b113e
fixes
Eldies Feb 13, 2025
a6d977f
fixes
Eldies Feb 13, 2025
9fe1e80
fixes
Eldies Feb 13, 2025
6db94c9
tests in test_masks.py from upstream
Eldies Feb 13, 2025
fcb8021
a bit of info on ImageColorChannel.UNCHANGED
Eldies Feb 13, 2025
29c6799
Merge branch 'dl/sync-with-upstream' into dl/opencv-fix
Eldies Feb 13, 2025
1d06dbb
Apply suggestions from code review
zhiltsov-max Feb 13, 2025
caddce7
Extend old image saving and loading tests
zhiltsov-max Feb 13, 2025
1936697
Refactor code
zhiltsov-max Feb 13, 2025
944878e
Fix formatting
zhiltsov-max Feb 13, 2025
be72397
Merge pull request #86 from cvat-ai/dl/opencv-fix
zhiltsov-max Feb 13, 2025
672ff01
Update src/datumaro/util/image.py
zhiltsov-max Feb 13, 2025
03cd9a5
Fix formatting
zhiltsov-max Feb 13, 2025
9cb2b56
tests for crypter
Eldies Feb 13, 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
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def parse_requirements(filename=CORE_REQUIREMENTS_FILE):

CORE_REQUIREMENTS = parse_requirements(CORE_REQUIREMENTS_FILE)
if strtobool(os.getenv("DATUMARO_HEADLESS", "0").lower()):
CORE_REQUIREMENTS.append("opencv-python-headless<4.11")
CORE_REQUIREMENTS.append("opencv-python-headless")
else:
CORE_REQUIREMENTS.append("opencv-python<4.11")
CORE_REQUIREMENTS.append("opencv-python")

DEFAULT_REQUIREMENTS = parse_requirements(DEFAULT_REQUIREMENTS_FILE)

Expand Down
14 changes: 4 additions & 10 deletions src/datumaro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,15 @@
from .components.dataset_base import CategoriesInfo, DatasetBase, DatasetItem, SubsetBase
from .components.dataset_item_storage import ItemStatus
from .components.dataset_storage import DatasetPatch
from .components.environment import Environment, PluginRegistry
from .components.environment import Environment
from .components.exporter import Exporter, ExportErrorPolicy, FailingExportErrorPolicy
from .components.hl_ops import ( # pylint: disable=redefined-builtin
export,
filter,
merge,
run_model,
transform,
validate,
)
from .components.hl_ops import HLOps
from .components.importer import Importer
from .components.launcher import Launcher
from .components.media import ByteImage, Image, MediaElement, PointCloud, Video, VideoFrame
from .components.media import Image, MediaElement, PointCloud, Video, VideoFrame
from .components.media_manager import MediaManager
from .components.progress_reporting import NullProgressReporter, ProgressReporter
from .components.registry import PluginRegistry
from .components.transformer import ItemTransform, ModelTransform, Transform
from .components.validator import Validator
from .util.definitions import DEFAULT_SUBSET_NAME
Expand Down
4 changes: 2 additions & 2 deletions src/datumaro/cli/commands/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

def build_parser(parser_ctor=argparse.ArgumentParser):
builtin_readers = sorted(set(Environment().importers) | set(Environment().extractors))
builtin_writers = sorted(Environment().converters)
builtin_writers = sorted(Environment().exporters)

parser = parser_ctor(
help="Convert an existing dataset to another format",
Expand Down Expand Up @@ -102,7 +102,7 @@ def convert_command(args):
env = Environment()

try:
converter = env.converters[args.output_format]
converter = env.exporters[args.output_format]
except KeyError:
raise CliException("Converter for format '%s' is not found" % args.output_format)
extra_args = converter.parse_cmdline(args.extra_args)
Expand Down
10 changes: 5 additions & 5 deletions src/datumaro/cli/commands/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import os.path as osp
from enum import Enum, auto

from datumaro.cli.util.compare import DistanceCompareVisualizer
from datumaro.components.comparator import DistanceComparator, EqualityComparator
from datumaro.components.errors import ProjectNotFoundError
from datumaro.util import dump_json_file
from datumaro.util.os_util import rmtree
from datumaro.util.scope import on_error_do, scope_add, scoped

from ..contexts.project.diff import DiffVisualizer
from ..util import MultilineFormatter
from ..util.errors import CliException
from ..util.project import generate_next_file_name, load_project, parse_full_revpath
Expand Down Expand Up @@ -78,12 +78,12 @@ def build_parser(parser_ctor=argparse.ArgumentParser):
formatter_class=MultilineFormatter,
)

formats = ", ".join(f.name for f in DiffVisualizer.OutputFormat)
formats = ", ".join(f.name for f in DistanceCompareVisualizer.OutputFormat)
comp_methods = ", ".join(m.name for m in ComparisonMethod)

def _parse_output_format(s):
try:
return DiffVisualizer.OutputFormat[s.lower()]
return DistanceCompareVisualizer.OutputFormat[s.lower()]
except KeyError:
raise argparse.ArgumentError(
"format",
Expand Down Expand Up @@ -140,7 +140,7 @@ def _parse_comparison_method(s):
"-f",
"--format",
type=_parse_output_format,
default=DiffVisualizer.DEFAULT_FORMAT.name,
default=DistanceCompareVisualizer.DEFAULT_FORMAT.name,
help="Output format, one of {} (default: %(default)s)".format(formats),
)

Expand Down Expand Up @@ -239,7 +239,7 @@ def diff_command(args):
elif args.method is ComparisonMethod.distance:
comparator = DistanceComparator(iou_threshold=args.iou_thresh)

with DiffVisualizer(
with DistanceCompareVisualizer(
save_dir=dst_dir, comparator=comparator, output_format=args.format
) as visualizer:
log.info("Saving diff to '%s'" % dst_dir)
Expand Down
4 changes: 2 additions & 2 deletions src/datumaro/cli/commands/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


def build_parser(parser_ctor=argparse.ArgumentParser):
builtin_writers = sorted(Environment().converters)
builtin_writers = sorted(Environment().exporters)
if TFDS_EXTRACTOR_AVAILABLE:
available_datasets = ", ".join(f"tfds:{name}" for name in AVAILABLE_TFDS_DATASETS)
else:
Expand Down Expand Up @@ -110,7 +110,7 @@ def download_command(args):
output_format = args.output_format or default_output_format

try:
converter = env.converters[output_format]
converter = env.exporters[output_format]
except KeyError:
raise CliException("Converter for format '%s' is not found" % output_format)
extra_args = converter.parse_cmdline(args.extra_args)
Expand Down
2 changes: 1 addition & 1 deletion src/datumaro/cli/commands/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def merge_command(args):
env = Environment()

try:
converter = env.converters[args.format]
converter = env.exporters[args.format]
except KeyError:
raise CliException("Converter for format '%s' is not found" % args.format)

Expand Down
2 changes: 1 addition & 1 deletion src/datumaro/cli/commands/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def patch_command(args):
scope_add(_project)

try:
converter = env.converters[target_dataset.format]
converter = env.exporters[target_dataset.format]
except KeyError:
raise CliException("Converter for format '%s' is not found" % args.format)

Expand Down
6 changes: 3 additions & 3 deletions src/datumaro/cli/contexts/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def list_options(cls):


def build_export_parser(parser_ctor=argparse.ArgumentParser):
builtins = sorted(Environment().converters)
builtins = sorted(Environment().exporters)

parser = parser_ctor(
help="Export project",
Expand Down Expand Up @@ -184,7 +184,7 @@ def export_command(args):
env = Environment()

try:
converter = env.converters[args.format]
converter = env.exporters[args.format]
except KeyError:
raise CliException("Converter for format '%s' is not found" % args.format)

Expand Down Expand Up @@ -798,7 +798,7 @@ def info_command(args):
print(" location:", project._root_dir)
print("Plugins:")
print(" extractors:", ", ".join(sorted(set(env.extractors) | set(env.importers))))
print(" converters:", ", ".join(env.converters))
print(" converters:", ", ".join(env.exporters))
print(" launchers:", ", ".join(env.launchers))

print("Models:")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from datumaro.util.image import save_image


class DiffVisualizer:
class DistanceCompareVisualizer:
class OutputFormat(Enum):
simple = auto()
tensorboard = auto()
Expand Down
Loading
Loading