Skip to content

Commit 8854528

Browse files
committed
change from --as-video to --frames
1 parent 8ad25ac commit 8854528

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

darwin/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def run(args, parser):
6262
elif args.action == "url":
6363
f.url(args.dataset)
6464
elif args.action == "push":
65-
f.upload_data(args.dataset, args.files, args.exclude, args.fps, args.path, args.as_video)
65+
f.upload_data(args.dataset, args.files, args.exclude, args.fps, args.path, args.frames)
6666
# Remove a project (remotely)
6767
elif args.action == "remove":
6868
f.remove_remote_dataset(args.dataset)

darwin/cli_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def upload_data(
439439
files_to_exclude: Optional[List[str]],
440440
fps: int,
441441
path: Optional[str],
442-
as_video: Optional[bool],
442+
frames: Optional[bool],
443443
):
444444
"""Uploads the files provided as parameter to the remote dataset selected
445445
@@ -464,7 +464,7 @@ def upload_data(
464464
client = _load_client()
465465
try:
466466
dataset = client.get_remote_dataset(dataset_identifier=dataset_slug)
467-
dataset.push(files_to_exclude=files_to_exclude, fps=fps, as_video=as_video, files_to_upload=files, path=path)
467+
dataset.push(files_to_exclude=files_to_exclude, fps=fps, as_frames=frames, files_to_upload=files, path=path)
468468
except NotFound as e:
469469
_error(f"No dataset with name '{e.name}'")
470470
except ValueError:

darwin/dataset/remote_dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def push(
6969
blocking: bool = True,
7070
multi_threaded: bool = True,
7171
fps: int = 1,
72-
as_video: bool = False,
72+
as_frames: bool = False,
7373
files_to_exclude: Optional[List[str]] = None,
7474
resume: bool = False,
7575
path: Optional[str] = None,
@@ -89,7 +89,7 @@ def push(
8989
List of files to exclude from the file scan (which is done only if files is None)
9090
fps : int
9191
Number of file per seconds to upload
92-
as_video: bool
92+
as_frames: bool
9393
Annotate as video.
9494
resume : bool
9595
Flag for signalling the resuming of a push
@@ -140,7 +140,7 @@ def push(
140140
dataset_id=str(self.dataset_id),
141141
filenames=files_to_upload,
142142
fps=fps,
143-
as_video=as_video,
143+
as_frames=as_frames,
144144
team=self.team,
145145
path=path,
146146
)

darwin/dataset/upload_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def add_files_to_dataset(
2424
filenames: List[Path],
2525
team: str,
2626
fps: Optional[int] = 1,
27-
as_video: Optional[bool] = False,
27+
as_frames: Optional[bool] = False,
2828
path: Optional[str] = None,
2929
):
3030
"""Helper function: upload images to an existing remote dataset
@@ -54,7 +54,7 @@ def add_files_to_dataset(
5454
payload = {
5555
"image_filenames": [image.name for image in images],
5656
"videos": [
57-
{"fps": fps, "annotate_as_video": as_video, "original_filename": video.name} for video in videos
57+
{"fps": fps, "annotate_as_video": not as_frames, "original_filename": video.name} for video in videos
5858
],
5959
}
6060
if path:

darwin/options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ def __init__(self):
7676
help="Excludes the files with the specified extension/s if a data folder is provided as data path. ",
7777
)
7878
parser_push.add_argument(
79-
"-f", "--fps", type=int, default="1", help="Frames per second for video split (recommended: 1)."
79+
"-f", "--fps", default="native", help="Frames per second for video split (recommended: 1), use 'native' to use the videos intrinsic fps."
8080
)
8181
parser_push.add_argument(
82-
"--as-video", action="store_true", help="Annotate a video as a video and not independent frames"
82+
"--frames", action="store_true", help="Annotate a video as independent frames"
8383
)
8484

8585
parser_push.add_argument("--path", type=str, default=None, help="Folder to upload the files into.")

0 commit comments

Comments
 (0)