Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion next_cvat/app/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def download(
"-f",
help="Load credentials from a specific .env file",
),
include_images: bool = typer.Option(
True,
"--include-images",
help="Include images in the dataset",
),
):
"""
Download annotations and images from a CVAT project.
Expand All @@ -35,4 +40,6 @@ def download(
username=settings_.username,
password=settings_.password,
token=settings_.token,
).download_(project_id=project_id, dataset_path=dataset_path)
).download_(
project_id=project_id, dataset_path=dataset_path, include_images=include_images
)
6 changes: 4 additions & 2 deletions next_cvat/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ def list_projects(self):
def project(self, project_id: int) -> Project:
return Project(client=self, id=project_id)

def download_(self, project_id, dataset_path):
return self.project(project_id=project_id).download_(dataset_path)
def download_(self, project_id, dataset_path, include_images=True):
return self.project(project_id=project_id).download_(
dataset_path=dataset_path, include_images=include_images
)


Project.model_rebuild()
Expand Down
4 changes: 2 additions & 2 deletions next_cvat/client/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def cvat(self) -> Generator[CVATProject, None, None]:
with self.client.cvat_client() as client:
yield client.projects.retrieve(self.id)

def download_(self, dataset_path: Union[str, Path]) -> Project:
def download_(self, dataset_path: Union[str, Path], include_images=True) -> Project:
"""Download project data to the specified path.

Args:
Expand All @@ -49,7 +49,7 @@ def download_(self, dataset_path: Union[str, Path]) -> Project:
cvat_project.export_dataset(
format_name="CVAT for images 1.1",
filename=temp_file_path,
include_images=True,
include_images=include_images,
)

# Extract contents
Expand Down