CLI
Command-Line Interface (CLI) Overview for Project Configuration and Management
The CLI, accessed via the alias kcli
, is designed to simplify the process of managing projects by offering configurable options for handling input materials, configuring project settings, and more. Below is a detailed guide on how to configure, upload materials, and manage your projects using the CLI.
Usage
To use the kcli
CLI, various command-line arguments are available for configuring and managing your projects. Below is an overview of each argument and its functionality:
Command-Line Arguments
--configs
Description: Configures the project settings. This must be used as a "standalone" argument to initialize the configuration.
--input
Description: Specifies the path to the root folder that contains the project materials (images, frames, or video files).
--prjType
Description: Defines the type of project you are creating. Options include:
image
: For projects consisting of image files.frames
: For projects where videos are split into frames (each frame is an image).video
: For projects based on video files.
--take_classes_from
Description: Specifies the project from which to clone classes. You provide the project name from which to take classes to use in the new project.
--dataset_name
Description: Defines the name of the project or dataset you are creating.
--delete_dataset
Description: The name of the dataset or project you wish to delete. This must be used as a "standalone" argument.
--slice_mode
Description: Determines how the video frames are sliced.
Choices:
1
: Each file is framed once.2
: Frame videos by a specific number of files (e.g., each 3 or 5 frames).3
: Upload after the entire video is framed.
--batch
Description: Defines the batch size for processing videos. Only integer values are accepted.
--output_dir
Description: Specifies the output directory where sliced video files will be saved.
Important: The output directory must not overlap with the input path to avoid conflicts.
--reconfigure
Description: Allows for reconfiguring project settings. This must be used as a "standalone" argument to modify configuration settings after initial setup.
Configuring the CLI
To configure the kcli
tool, you will need to set various parameters that allow it to interact with your storage service (AWS or Google Cloud). You can initialize the configuration with the following command:
During the configuration process, you will need to provide the following credentials and details:
AWS Configuration:
aws_access_key_id
: AWS access key.aws_secret_access_key
: AWS secret access key.bucket_name
: The name of the S3 bucket.description
: (Optional) A description of the configuration.storage_type
: Set toaws
for Amazon Web Services.value
: The storage path (e.g.,s3/keylabs/
).
Google Cloud Platform Configuration:
gcp_credential_path
: Absolute path to your Google Cloud credentials file.description
: (Optional) A description of the configuration.storage_type
: Set togcp
for Google Cloud Platform.value
: The storage path (e.g.,gs/keylabs/
).
Reconfiguring the CLI
If you need to modify any configuration settings after the initial setup, use the following command:
If you have more than one storage prefix, you will be given the option to modify any of the existing prefixes.
Uploading Materials
The kcli
CLI allows for uploading different types of materials, such as images, frames, and videos. Below are the commands for each type:
Uploading Images
To upload a collection of images, use the following command:
Uploading Frames
For uploading frames from a video, the following command can be used:
Uploading Videos
Uploading videos can be done in three different modes using the --slice_mode
argument:
Upload each file once framed:
Upload by a specific number of framed files (e.g., each 3 or 5 frames):
Upload after complete framing (i.e., upload once everything is framed):
Specifying Output Directory
You can specify an output directory for sliced video frames using the --output_dir
argument. Make sure that the output directory path does not overlap with the input path. If not specified, a default output folder named cut
will be created within the input path:
Deleting a Project
To delete a project, you can use the following command:
This command will remove the specified project and all associated files from the system.
Last updated