create_project

imerit_ango.sdk.SDK.

create_project(name, description, project_type, pct_config)

Create a new project with the specified name and description.

Parameters

  • name: string

    • The name of the project to be created. This field is required and cannot be left empty.

    • Example: 'Project One'

  • description: string, optional, default ""

    • A brief description of the project.

    • Example: 'Vehicle Classification Project'

  • project_type: ProjectType, optional, default None

    • Specifies the type of the project.

    • Options:

      • ProjectType.Ango

      • ProjectType.PCT

  • pct_config: PctConfig, optional, default None

    • Configuration object for PCT projects.

    • PctConfig

      • allow_overlapping: bool, default False

        • Allows multiple annotations to overlap within the same frame.

      • tracking_multiple_sensors: bool, default False

        • Enables tracking across multiple sensors.

      • segmentation_mode: bool, default False

        • Activates segmentation mode.

Returns:

  • output: dict

    • A dictionary containing the result of the operation.

Example

Create a standard Ango project:

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')

ango_sdk = SDK(api_key)

response = ango_sdk.create_project(name="New Ango Project",
                                   description="Created via SDK")

project_id = response.get("data", {}).get("project", {}).get("_id")
Returns
{
    "status": "success",
    "data": {
        "project": {
            "errorSchema": {
                "Missing": [],
                "Wrong": [],
                "Unqualified": []
            },
            "role": "<USER ROLE>",
            "description": "Created via SDK",
            "categorySchema": {
                "tools": [],
                "classifications": [],
                "relations": []
            },
            "benchmarkEnabled": false,
            "benchmarkRatio": 10,
            "customValidationEnabled": false,
            "submissionPrevent": false,
            "validationFunction": "",
            "gcSyncEnabled": false,
            "deleted": false,
            "ocrLanguage": "eng",
            "idleTimeout": 300,
            "errorCodesEnabled": false,
            "exportStorageEnabled": false,
            "taskSkipEnabled": true,
            "unassignSkippedTask": false,
            "_id": "<PROJECT ID>",
            "name": "New Ango Project",
            "owner": "<USER EMAIL>",
            "organization": "<ORGANIZATION ID>",
            "createdAt": "<CREATED AT TIME>",
            "assignedTo": [],
            "pluginPresets": [],
            "batches": [],
            "stages": [
                {
                    "logic": {
                        "conditions": []
                    },
                    "assignedTo": [],
                    "next": [
                        "Label"
                    ],
                    "readOnly": false,
                    "rememberAssignee": true,
                    "queueLIFO": false,
                    "autoForward": true,
                    "_id": "<ID>",
                    "id": "Start",
                    "name": "Start",
                    "type": "Start",
                    "position": {
                        "x": 0,
                        "y": 50
                    }
                },
                {
                    "logic": {
                        "conditions": []
                    },
                    "assignedTo": [],
                    "next": [],
                    "readOnly": false,
                    "rememberAssignee": true,
                    "queueLIFO": false,
                    "autoForward": true,
                    "_id": "<ID>",
                    "id": "Complete",
                    "name": "Complete",
                    "type": "Complete",
                    "position": {
                        "x": 600,
                        "y": 78
                    }
                },
                {
                    "logic": {
                        "conditions": []
                    },
                    "assignedTo": [],
                    "next": [
                        "Complete"
                    ],
                    "readOnly": false,
                    "rememberAssignee": true,
                    "queueLIFO": false,
                    "autoForward": true,
                    "_id": "<ID>",
                    "id": "Label",
                    "name": "Label",
                    "type": "Label",
                    "position": {
                        "x": 300,
                        "y": 50
                    }
                }
            ],
            "assetBuilderTemplates": [],
            "__v": 0
        }
    }
}

Create a PCT project:

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.enums import ProjectType
from imerit_ango.models.pct_config import PctConfig

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')

ango_sdk = SDK(api_key)

pct_configuration = PctConfig(allow_overlapping=False, 
                              tracking_multiple_sensors=False, 
                              segmentation_mode=False)

response = ango_sdk.create_project(name="New PCT Project",
                                   description="Created via SDK",
                                   project_type=ProjectType.PCT,
                                   pct_config=pct_configuration)

project_id = response.get("data", {}).get("project", {}).get("_id")

Last updated