DS2
This namespace provides python functions that are more generally used for AI development.
__init__(apptoken)
- apptoken (str) : Access apptoken for making client requests.
- 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.
Returns a storage of the user information as a corresponding apptoken of user object.
get_user_info()
- class util.User
- User information
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)
- 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'.
- class Project
- Project ID
Creates an CLICK AI project with uploaded data in ds2.ai by using dataconneotor ID.
create_project(dataconnector, training_method)
- 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'.
- class Project
- Project ID
Creates an CLICK AI project with model_file.
load_model(model_file)
- model_file (.pth, .zip) : An AI model file made by Pytorch and tensorflow2.
- class Project
- Project ID
Reads the created projects and returns the list of project objects according to the parameters.
get_projects(count=25, start=1, desc=True)
- 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 ifFalse
.
- class Project
- List of project IDs
Reads and returns the pre-created project as a corresponding project_id.
get_project(project_id)
- project_id (int) : Pre-created project ID.
- class Project
- Project ID
Reads and returns the pre-developed AI model as a corresponding model_id.
get_model(model_id)
- model_id (int) : Pre-developed AI model ID.
- class Model
- Model ID
Returns the list of the quick start models' ID in AI Market.
get_quick_models(count=25, start=1, desc=True)
- 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 ifFalse
.
- class Project
- *List of the quick start models
- 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'.
Reads a quick start model as a corresponding slug name.
get_quick_model_by_slug_name(slug_name)
- 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'.
- Class MarketModel
- The quick start model corresponding to input slug name
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)
- 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.
- class Dataconnector
- Dataconnector ID
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)
- 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 ifFalse
- class Dataconnector
- List of dataconnector IDs
Reads the created dataconnector as a corresponding dataconnector ID.
get_dataconnector(dataconnector_id)
- dataconnector_id (int) : Pre-created dataconnector ID.
- class Dataconnector
- Dataconnector ID
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)
- 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.
- class Labelproject
- Labeling AI project ID
- You can enter only one value among data_file, dataconnector, and datarconnetors.
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)
- 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 ifFalse
- class Labelproject
- List of Labeling AI project IDs
Reads the created label project as a corresponding Labeling AI project ID.
get_labelproject(labelproject_id)
- labelproject_id (int) : Pre-created label project ID.
- class Labelproject
- Labeling AI project id
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)
- 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 ifFalse
- class Opsproject
- List of ops project IDs
Reads the created ops project in Skyhub AI as a corresponding ops project ID.
get_opsproject(opsproject_id)
- labelproject_id (int) :
- Pre-created ops project ID.
- class Opsproject
- Ops project ID
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)
- 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 ifFalse
- class Jupyterproject
- List of Jupyter project in Custom training IDs
Reads the created jupyter project in Cutom training in Click AI as a corresponding jupyter project ID.
get_jupyterproject(jupyterproject_id)
- jupyterproject_id (int) : Pre-created jupyter project ID.
- class Jupyterproject
- Jupyter project ID
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")
- 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 ifFalse
- 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).
- class Asynctask
- List of asynctask IDs
Reads the asynctask which you can check the prediction result by your AI as a corresponding asynctask ID.
get_asynctask(asynctask_id)
- asynctask_id (int) : Pre-created asynctask ID.
- class Asynctask
- Asynctask project ID
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=''
)
- 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) : When 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.
- class Project
- Start auto labeling
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)
- 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.
- class Project
- Start Click AI development
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")
- 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.
- class Opsproject
- Ops project id
- You can find region information with DS2.get_server_lists().
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
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)
- 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.
- class Project
- You can find region information with DS2.get_server_lists().
Returns a predicted value using a pre-generated AI model ID.
predict(data, model_id=None, quick_model_name="", return_type="info")
- 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.
- class Project
- Predicted value
Returns variable names by hosting region and server specification.
get_server_lists()
- class Project
- Predicted value
Last modified 10mo ago