Skip to content

ds2ai.DS2

class DS2()

This namespace provides python functions that are more generally used for AI development.

init()

__init__(apptoken)
  • Parmeters:
    • apptoken (str) : Access apptoken for making client requests.
  • Fields:
    • utilClass : Get class Util as an object.
    • url: DS2 API url information.
    • apptoken: Apptoken (input data).
    • user: User information with input apptoken information.
    • user_token: User information with input apptoken information.

get_user_info()

Returns a storage of the user information as a corresponding apptoken of user object.

get_user_info()
  • Return type:
    • class util.User
    • User information

create_project()

Creates an CLICK AI project with a data_file in the local repository.

create_project(data_file, predict_column_name=None, frame=None, training_method=None)
  • Parmeters:
    • data_file (.csv, .zip, .mp4, .mov): The local path of the file you want to upload to the server. The data file format supports csv, mp4, mov, and zip, and the zip file can include image files such as jpg, jpeg, png, and gif format.
    • predict_column_name (int) : When the format of data_file is .csv, the predict column name. (if data_file has label data, input the column name the data file has. Otherwise, enter a new name you want as the result column name) If the format of data_file is not .csv, leave as default value.
    • frame (int) : When the format of data_file is .mp4 or .mov, a number of frames per minute betwwen 1 and 600. If the format of data_file is neither .mp4 nor .mov, leave it as default.
    • training_method (str) : One of the suitable training methods with your data_file from 'image', 'normal_classification', 'normal_regression', 'object_detection', 'time_series', 'time_series_regression', 'time_series_classification', 'recommender' or 'image_classification'.
  • Return type:
    • class Project
    • Project ID


create_project_by_dataconnector()

Creates an CLICK AI project with uploaded data in ds2.ai by using dataconneotor ID.

create_project(dataconnector, training_method)
  • Parmeters:
    • dataconnector (int) : Dataconnector ID which you can get if you have uploaded your data_file to server. You can find the dataconnector Id by DS2.get_dataconnectors()
    • training_method (str) : One of the suitable training methods with your data_file from 'image', 'normal_classification', 'normal_regression', 'object_detection', 'time_series', 'time_series_regression', 'time_series_classification', 'recommender' or 'image_classification'.
  • Return type:
    • class Project
    • Project ID


load_model()

Creates an CLICK AI project with model_file.

load_model(model_file)
  • Parmeters:

    • model_file (.pth, .zip) : an AI model file made by Pytorch and tensorflow2.
  • Return type:

    • class Project
    • Project ID


get_projects()

Reads the created projects and returns the list of project objects according to the parameters.

get_projects(count=25, start=1, desc=True)
  • Parmeters:
    • count (int) : Number of projects you want to load.
    • start (int) : The start order of the project ID you want to load.
    • desc (bool) : Sorted by descending if "True", ascending if "False".
  • Return type:
    • class Project
    • List of project IDs

get_project()

Reads and returns the pre-created project as a corresponding project_id.

get_project(project_id)
  • Parmeters:
    • project_id (int) : Pre-created project ID.
  • Return type:
    • class Project
    • Project ID

get_model()

Reads and returns the pre-developed AI model as a corresponding model_id.

get_model(model_id)
  • Parmeters:
    • model_id (int) : Pre-developed AI model ID.
  • Return type:
    • class Model
    • Model ID

get_quick_models()

Returns the list of the quick start models' ID in AI Market.

get_quick_models(count=25, start=1, desc=True)
  • Parmeters:
    • count (int) : Number of quick model ids you want to load.
    • start (int) : The start order of the project you want to load.
    • desc (bool) : Sorted by descending if "True", ascending if "False".
  • Return type:
    • class Project
    • *List of the quick start models.
  • Reference:
    • DS2 AI currently supports the following items as quick start models.
    • 'person', 'ocr', 'person-skeleton', 'face-blur', 'face-landmark', 'living', 'dog-and-cat', 'animal', 'sport', 'hard-hat', 'transportation-segmentation', 'transportation'

get_quick_model_by_slug_name()

Reads a quick start model as a corresponding slug name.

get_quick_model_by_slug_name(slug_name)
  • Parmeters:
    • slug_name (str) : One of the slug names of quick start models from 'person', 'ocr', 'person-skeleton', 'face-blur', 'face-landmark', 'living', 'dog-and-cat', 'animal', 'sport', 'hard-hat', 'transportation-segmentation', or 'transportation'.
  • Return type:
    • Class MarketModel
    • The quick start model corresponding to input slug name

create_dataconnector():

Uploads data file in server and returns the data connector ID of the uploaded data.

create_dataconnector(data_file, has_label_data=False, predict_column_name=None,
                frame=60)
  • Parmeters:
    • data_file (file) : The local path of the file you want to upload to the server. The data file format supports csv, mp4, mov, and zip, and the zip file can include image files such as jpg, jpeg, png, and gif format.
    • has_label_data (bool) : True if data_file includes label data, False otherwise.
    • predict_column_name (str) : When the format of data_file is .csv, enter the result column name. (if has_label_data is True, input the column name the data file has, if False, enter an name you want as the result column name) When the format of data_file is not a .csv, leave as default value(None).
    • frame (int) : When the format of data_file is .mp4 or .mov, a number of frames per minute betwwen 1 and 600. If the format of data_file is neither .mp4 nor .mov, leave it as default.
  • Return type:
    • class Dataconnector
    • Dataconnector ID

get_dataconnetors():

Reads the created dataconnectors IDs and returns the list of IDs of them according to the parameters.

get_dataconnectors(count=25, page=1, desc=True)
  • Parmeters:
    • count (int) : Number of dataconnectors you want to read
    • page (int) : The page of the dataconnecots you want to read
    • desc (bool) : Sorted by descending if "True", ascending if "False"
  • Return type:
    • class Dataconnector
    • List of dataconnector IDs

get_dataconnetor():

Reads the created dataconnector as a corresponding dataconnector ID.

get_dataconnector(dataconnector_id)
  • Parmeters:
    • dataconnector_id (int) : Pre-created dataconnector ID.
  • Return type:
    • class Dataconnector
    • Dataconnector ID

create_labelproject():

Create an Labeling AI project for any dataset or model_file.

create_labelproject(data_file=None, dataconnector=None, dataconnectors=None,
                    training_method=None, name=None, frame=60)
  • Parmeters:
    • data_file (file) : The local path of the file you want to upload to the server. The data file format supports csv, mp4, mov, and zip, and the zip file can include image files such as jpg, jpeg, png, and gif format.
    • dataconnector (int) : Dataconnector id which you can get if from ds2ai.DS2.create_dataconnector.
    • dataconnectors (list) : Dataconnector IDs of two or more datasets you want to create to one label project
    • training_method (str) : One of the training methods from 'image', 'normal_classification', 'normal_regression', 'object_detection', 'time_series', 'time_series_regression', 'time_series_classification', 'recommender', or 'image_classification'.
    • name (str) : Project name.
    • frame (int) : When the format of data_file is .mp4 or .mov, a number of frames per minute betwwen 1 and 600. If the format of data_file is neither .mp4 nor .mov, leave it as default.
  • Return type:
    • class Labelproject
    • Labeling AI project ID
  • Reference:
    • You can enter only one value among data_file, dataconnector, and datarconnetors.

get_labelprojects():

Reads the created label projects and returns the list of IDs of them according to the parameters.

get_labelprojects(count=25, page=1, desc=True)
  • Parmeters:
    • count(int) : Number of label projects you want to read.
    • page(int) : The page of the label projects you want to read.
    • desc (Booleen) : Sorted by descending if "True", ascending if "False".
  • Return type:
    • class Labelproject
    • List of Labeling AI project IDs

get_labelproject():

Reads the created label project as a corresponding Labeling AI project ID.

get_labelproject(labelproject_id)
  • Parmeters:
    • labelproject_id (int) : Pre-created label project ID.
  • Return type:
    • class Labelproject
    • Labeling AI project id

get_opsprojects():

Reads the created ops projects in Skyhub AI and returns the list of IDs of them according to the parameters.

get_opsprojects(count=25, page=1, desc=True)
  • Parmeters:
    • count(int) : Number of ops projects you want to read.
    • page(int) : The page of the ops projects you want to read.
    • desc (Booleen) : Sorted by descending if "True", ascending if "False".
  • Return type:
    • class Opsproject
    • List of ops project IDs

get_opsproject():

Reads the created ops project in Skyhub AI as a corresponding ops project ID.

get_opsproject(opsproject_id)
  • Parmeters:
    • labelproject_id (int) : Pre-created ops project ID.
  • Return type:
    • class Opsproject
    • Ops project ID

get_jupyterprojects():

Reads the created jupyter projectsin Cutom training in Click AI and returns the list of IDs of them according to the parameters.

get_jupyterprojects(count=25, page=1, desc=True)
  • Parmeters:
    • count (int) : Number of jupyter projects you want to read.
    • page (int) : The page of the jupyter projects you want to read.
    • desc (bool) : Sorted by descending if "True", ascending if "False".
  • Return type:
    • class Jupyterproject
    • List of Jupyter project in Custom training IDs

get_jupyterproject():

Reads the created jupyter project in Cutom training in Click AI as a corresponding jupyter project ID.

get_jupyterproject(jupyterproject_id)
  • Parmeters:
    • jupyterproject_id (int) : Pre-created jupyter project id
  • Return type:
    • class Jupyterproject
    • Jupyter project id

get_asynctasks():

Reads the asynctasks which you can check prediction results by your AI and returns the list of IDs of them according to the parameters.

get_asynctasks(count=25, page=1, desc=True, tasktype="all")
  • Parmeters:
    • count (int) : Number of asynctasks you want to read.
    • page (int) : The page of the asynctasks you want to read.
    • desc (bool) : Sorted by descending if "True", ascending if "False".
    • tasktype (str) : Task type that you want to check the status from "all", "exportCoco"(extract COCO dataset), "autoLabeling" (auto labeling), "runMovie" (prediction of video), "runAll"(prediction of all).
  • Return type:
    • class Asynctask
    • List of asynctask IDs

get_asynctask():

Reads the asynctask which you can check the prediction result by your AI as a corresponding asynctask ID.

get_asynctask(asynctask_id)
  • Parmeters:
    • asynctask_id (int) : Pre-created asynctask ID.
  • Return type:
    • class Asynctask
    • Asynctask project id

start_auto_labeling():

Executes auto-labeling immediately from loading data file without using dataconnector.

start_auto_labeling(data_file, amount, has_label_data=False, predict_column_name=None, frame_value=60,
                ai_type="general", autolabeling_type="box", general_ai_type="person",
                model_id=None, custom_ai_stage=0, preprocessing_ai_type={}, labeling_class=[],
                training_method="object_detection", name='', description=''
                )
  • Parmeters:
    • data_file (files) : The local path of the file you want to upload to the server. The data file format supports csv, mp4, mov, and zip, and the zip file can include image files such as jpg, jpeg, png, and gif format.
    • amount (int) : The amount of images you desire to auto-labeling.
    • has_label_data (bool) : "True"" if data_file includes label data, "False" otherwise.
    • predict_column_name (str) : When the format of data_file is .csv, result column name. (if has_label_data is True, input the column name the data file has, if False, enter an name you want as the result column name) When the format of data_file is not .csv, leave as default value(None).
    • frame_value (int) :When the format of data_file is .mp4 or .mov, a number of frames per minute betwwen 1 and 600. If the format of data_file is neither .mp4 nor .mov, leave it as default.
    • ai_type (str) : Depending on whether training for autolabeling is required, choose 'custom'(required) or 'general'(not required).
    • autolabeling_type (str) : When workapp is 'object_detection', choose a type of labeling 'box' or 'polygon'.
    • general_ai_type (str) : Whei ai_type is 'general', select labeling AI already created from 'person', 'animal', 'autonomous_driving', 'face_point detection' and 'people_keypoints'.
    • model_id (int) : When ai_type is 'custom', enter the model id of the custom AI you want to auto-label.
    • custom_ai_stage (int) : custom_ai_stage
    • preprocessing_ai_type (dict) : Enter preprocessing options (Currently, 'face_de-identification' is supported)
    • labeling_class (str) : The class(es) name of the object you want to auto-label.
    • training_method (str) : One of the training_methods from 'object_detection', 'image', 'normal_classification', 'normal_regression' and 'text'.
    • name (str): Set the project name.
    • description (str): Describe the project.
  • Return type:
    • class Project
    • Start auto labeling

train():

Executes development of Click AI immediately from loading data file without using dataconnector.

train(data_file, training_method, value_for_predict, option="accuracy", frame=60)
  • Parmeters:
    • data_file (files) : The local path of the file you want to upload to the server. The data file format supports csv, mp4, mov, and zip, and the zip file can include image files such as jpg, jpeg, png, and gif format.
    • training_method (str) : Select one of the training methods from 'image', 'normal_classification', 'normal_regression', 'object_detection', 'time_series', 'time_series_regression', 'time_series_classification', 'recommender', 'image_classification''normal_regression' and 'text'.
    • value_for_predict (str)): When the format of data_file is .csv, result column name. (if has_label_data is "True", input the column name the data file has, if "False", enter an name you want as the result column name) When the format of data_file is not .csv, leave as default value.
    • option (str) : One of the training options, 'accuracy' for higher accuracy, or 'speed' for faster training speed.
    • frame (int) :When the format of data_file is .mp4 or .mov, a number of frames per minute betwwen 1 and 600. If the format of data_file is neither .mp4 nor .mov, leave it as default.
  • Return type:
    • class Project
    • Start Click AI development

deploy():

Deploys AI models to cloud servers with specifications under the desired hosting region.

deploy(model_file,  name=None, cloud_type="AWS", region="us-west-1", server_type="g4dn.xlarge")
  • Parmeters:
    • model_file (file) : Local path of the model file you want to deploy.
    • name (str) : Project name.
    • cloud_type (str) : Aserver leasing company (currently only 'AWS' supported).
    • region (str) : The hosting region.
    • server_type (str) : The server instance of the desired specification.
  • Return type:
    • class Opsproject
    • Ops project id
  • Reference:
    • you can find region information with DS2.get_server_lists().

get_magic_code():

Returns a the magic code for setting variable values ​​with optimal combinations for AI training.

get_magic_code(training_method, data_file, value_for_predict)
  • Parmeters:
    • training_method (str) : Select one of the training methods from 'image', 'normal_classification', 'normal_regression', 'object_detection', 'time_series', 'time_series_regression', 'time_series_classification', 'recommender', 'image_classification''normal_regression' and 'text'.
    • data_file (files) : The local path of the file you want to upload to the server. The data file format supports csv, mp4, mov, and zip, and the zip file can include image files such as jpg, jpeg, png, and gif format.
    • value_for_predict (str) : When the format of data_file is .csv, result column. name. (if has_label_data is True, input the column name the data file has, if False, enter an name you want as the result column name) When the format of data_file is not .csv, leave as default value.
  • Return type:
    • class Project

rent_custom_training_server():

Rents an inference training server in prefered cloud environment for Custom training of Click AI

rent_custom_training_server(cloud_type="AWS", region="us-west-1", server_type="g4dn.xlarge", name=None)
  • Parmeters:
    • cloud_type (str) : Choose a server leasing company (currently only 'AWS' supported).
    • region (str) : Choose the hosting region.
    • server_type (str) : The server instance of the desired specification.
    • name (str) : Project name.
  • Return type:
    • class Project
  • Reference:
    • you can find region information with DS2.get_server_lists().

predict():

Returns a predicted value using a pre-generated AI model id.

predict(data, model_id=None, quick_model_name="", return_type="info")
  • Parmeters:
    • data (str) : Input data to predict the result.
    • model_id (int) : Pre-created model ID.
    • quick_model_name (str) : One of the slug names of quick start models from 'person', 'ocr', 'person-skeleton', 'face-blur', 'face-landmark', 'living', 'dog-and-cat', 'animal', 'sport', 'hard-hat', 'transportation-segmentation', 'transportation'.
    • return_type (str) : The "info" returns the detailed information of the predicted value. When the predict data is image or object detection, "xai" returns the detailed information of the predicted value as xai.
  • Return type:
    • class Project
    • Predicted value

get_server_lists():

Returns variable names by hosting region and server specification.

get_server_lists()
  • Return type:
    • class Project
    • Predicted value