From 367abbaed64b87a38189611560924b02678c9f5b Mon Sep 17 00:00:00 2001 From: Daan Krol Date: Wed, 20 Nov 2024 16:52:54 +0100 Subject: [PATCH 1/2] Running all cells in one go will throw error since project creation is not completed completely. --- notebooks/001_create_project.ipynb | 443 ++++++++++++++++++++++++----- 1 file changed, 378 insertions(+), 65 deletions(-) diff --git a/notebooks/001_create_project.ipynb b/notebooks/001_create_project.ipynb index 4d2f5dd2..0dedcf2d 100644 --- a/notebooks/001_create_project.ipynb +++ b/notebooks/001_create_project.ipynb @@ -14,15 +14,20 @@ }, { "cell_type": "code", - "execution_count": null, "id": "3cb49dd2-7032-40e0-a4c2-8203ba1072bf", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:40:38.773121Z", + "start_time": "2024-11-20T15:40:38.769997Z" + } + }, "source": [ "from geti_sdk.utils import get_server_details_from_env\n", "\n", "geti_server_configuration = get_server_details_from_env()" - ] + ], + "outputs": [], + "execution_count": 67 }, { "cell_type": "markdown", @@ -34,15 +39,20 @@ }, { "cell_type": "code", - "execution_count": null, "id": "ba8318f4-3d97-4949-abf0-6cdafe46572e", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:40:39.315746Z", + "start_time": "2024-11-20T15:40:38.776172Z" + } + }, "source": [ "from geti_sdk import Geti\n", "\n", "geti = Geti(server_config=geti_server_configuration)" - ] + ], + "outputs": [], + "execution_count": 68 }, { "cell_type": "markdown", @@ -55,17 +65,36 @@ }, { "cell_type": "code", - "execution_count": null, "id": "081e700d-9e2e-4022-b4d6-dac3adf1d4f8", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:40:39.940011Z", + "start_time": "2024-11-20T15:40:39.327053Z" + } + }, "source": [ "from geti_sdk.rest_clients import ProjectClient\n", "\n", "project_client = ProjectClient(session=geti.session, workspace_id=geti.workspace_id)\n", "\n", "projects = project_client.list_projects()" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1 projects were found on the platform:\n", + "\n", + " Project: Segmentation demo\n", + " Task 1: Segmentation task\n", + " Labels: ['dog', 'cat', 'horse', 'Empty']\n", + "\n", + "\n" + ] + } + ], + "execution_count": 69 }, { "cell_type": "markdown", @@ -89,10 +118,13 @@ }, { "cell_type": "code", - "execution_count": null, "id": "30e46136-5283-4e3d-8dcf-7a89bee4de6b", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:40:39.963221Z", + "start_time": "2024-11-20T15:40:39.961033Z" + } + }, "source": [ "from geti_sdk.data_models.enums import TaskType\n", "\n", @@ -101,7 +133,26 @@ "for task_type in TaskType:\n", " if task_type.is_trainable:\n", " print(\" \" + str(task_type))" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Supported task types:\n", + " detection\n", + " segmentation\n", + " classification\n", + " anomaly_classification\n", + " anomaly_detection\n", + " anomaly_segmentation\n", + " anomaly\n", + " instance_segmentation\n", + " rotated_detection\n" + ] + } + ], + "execution_count": 70 }, { "cell_type": "markdown", @@ -138,29 +189,47 @@ }, { "cell_type": "code", - "execution_count": null, "id": "b18c25d1-f53b-495e-a48e-ee89b7f95d4e", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:40:39.978450Z", + "start_time": "2024-11-20T15:40:39.976701Z" + } + }, "source": [ "# First set the project parameters. Feel free to experiment here!\n", "PROJECT_NAME = \"Segmentation demo\"\n", "PROJECT_TYPE = \"segmentation\"\n", "LABELS = [[\"dog\", \"cat\", \"horse\"]]" - ] + ], + "outputs": [], + "execution_count": 71 }, { "cell_type": "code", - "execution_count": null, "id": "4941f712-f97b-48ff-a11b-74687d0bb49f", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:40:40.600445Z", + "start_time": "2024-11-20T15:40:39.993833Z" + } + }, "source": [ "# Now, use the project client to create the project\n", "project = project_client.create_project(\n", " project_name=PROJECT_NAME, project_type=PROJECT_TYPE, labels=LABELS\n", ")" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2024-11-20 16:40:40,357 - INFO - Project created successfully.\n" + ] + } + ], + "execution_count": 72 }, { "cell_type": "markdown", @@ -173,13 +242,29 @@ }, { "cell_type": "code", - "execution_count": null, "id": "c9d3496b-663d-41d3-b381-5e05b4c8e5b0", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:40:40.610576Z", + "start_time": "2024-11-20T15:40:40.608611Z" + } + }, "source": [ "print(project.summary)" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Project: Segmentation demo\n", + " Task 1: Segmentation task\n", + " Labels: ['dog', 'cat', 'horse', 'Empty']\n", + "\n" + ] + } + ], + "execution_count": 73 }, { "cell_type": "markdown", @@ -191,13 +276,53 @@ }, { "cell_type": "code", - "execution_count": null, "id": "8786e8df-3ecb-4947-ad71-c8512e0b22ac", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:40:40.630251Z", + "start_time": "2024-11-20T15:40:40.627690Z" + } + }, "source": [ "print(project.overview)" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'datasets': [{'name': 'Dataset', 'use_for_training': True}],\n", + " 'name': 'Segmentation demo',\n", + " 'performance': {'task_performances': [{'task_id': '673e02f8f57f93285cef276f'}]},\n", + " 'pipeline': {'connections': [{'from': 'Dataset', 'to': 'Segmentation task'}],\n", + " 'tasks': [{'task_type': 'dataset', 'title': 'Dataset'},\n", + " {'labels': [{'color': '#ffffffff',\n", + " 'group': 'segmentation task label group',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'dog'},\n", + " {'color': '#ffffffff',\n", + " 'group': 'segmentation task label group',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'cat'},\n", + " {'color': '#ffffffff',\n", + " 'group': 'segmentation task label group',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'horse'},\n", + " {'color': '#000000ff',\n", + " 'group': 'Empty',\n", + " 'is_anomalous': False,\n", + " 'is_empty': True,\n", + " 'name': 'Empty'}],\n", + " 'task_type': 'segmentation',\n", + " 'title': 'Segmentation task'}]},\n", + " 'storage_info': {}}\n" + ] + } + ], + "execution_count": 74 }, { "cell_type": "markdown", @@ -209,16 +334,37 @@ }, { "cell_type": "code", - "execution_count": null, "id": "01cb2ee6-9d45-4d17-aa6f-2ac0330ce369", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:40:40.649417Z", + "start_time": "2024-11-20T15:40:40.647367Z" + } + }, "source": [ "task_list = project.get_trainable_tasks()\n", "print(f\"Project '{project.name}' contains {len(task_list)} trainable tasks.\")\n", "for task in task_list:\n", " print(task.summary)" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Project 'Segmentation demo' contains 1 trainable tasks.\n", + "Task: Segmentation task\n", + " Type: segmentation \n", + " Labels:\n", + " Name: dog, Group: segmentation task label group, Parent: None\n", + " Name: cat, Group: segmentation task label group, Parent: None\n", + " Name: horse, Group: segmentation task label group, Parent: None\n", + " Name: Empty, Group: Empty, Parent: None\n", + "\n" + ] + } + ], + "execution_count": 75 }, { "cell_type": "markdown", @@ -230,14 +376,33 @@ }, { "cell_type": "code", - "execution_count": null, "id": "71dbcca8-b79e-441d-9143-091c2b08ba35", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:40:41.401583Z", + "start_time": "2024-11-20T15:40:40.673069Z" + } + }, "source": [ "project = project_client.get_project(project_name=PROJECT_NAME)\n", "print(project.summary)" - ] + ], + "outputs": [ + { + "ename": "ValueError", + "evalue": "A total of 2 projects named `Segmentation demo` were found in the workspace. Unable to uniquely identify the desired project. Please provide a `project_id` to ensure the proper project is returned. The following projects were found:['Name: Segmentation demo,\\t Type: segmentation,\\t ID: 673e02f8f57f93285cef276c,\\t creation_date: 2024-11-20 15:40:40.217000+00:00\\n', 'Name: Segmentation demo,\\t Type: segmentation,\\t ID: 673e0204f57f93285cef2726,\\t creation_date: 2024-11-20 15:36:37.464000+00:00\\n']", + "output_type": "error", + "traceback": [ + "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[0;31mValueError\u001B[0m Traceback (most recent call last)", + "Cell \u001B[0;32mIn[76], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m project \u001B[38;5;241m=\u001B[39m \u001B[43mproject_client\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_project\u001B[49m\u001B[43m(\u001B[49m\u001B[43mproject_name\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mPROJECT_NAME\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 2\u001B[0m \u001B[38;5;28mprint\u001B[39m(project\u001B[38;5;241m.\u001B[39msummary)\n", + "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/rest_clients/project_client/project_client.py:714\u001B[0m, in \u001B[0;36mProjectClient.get_project\u001B[0;34m(self, project_name, project_id, project)\u001B[0m\n\u001B[1;32m 712\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mget_project_by_name(project_name\u001B[38;5;241m=\u001B[39mproject\u001B[38;5;241m.\u001B[39mname)\n\u001B[1;32m 713\u001B[0m \u001B[38;5;28;01melif\u001B[39;00m project_name \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[0;32m--> 714\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_project_by_name\u001B[49m\u001B[43m(\u001B[49m\u001B[43mproject_name\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mproject_name\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 715\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m 716\u001B[0m \u001B[38;5;66;03m# No parameters provided\u001B[39;00m\n\u001B[1;32m 717\u001B[0m \u001B[38;5;66;03m# Warn the user and return None\u001B[39;00m\n\u001B[1;32m 718\u001B[0m warnings\u001B[38;5;241m.\u001B[39mwarn(\n\u001B[1;32m 719\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mAt least one of the parameters `project_name`, `project_id`, or \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 720\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124m`project` must be provided.\u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 721\u001B[0m )\n", + "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/rest_clients/project_client/project_client.py:146\u001B[0m, in \u001B[0;36mProjectClient.get_project_by_name\u001B[0;34m(self, project_name)\u001B[0m\n\u001B[1;32m 138\u001B[0m detailed_matches \u001B[38;5;241m=\u001B[39m [\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mget_project_by_id(match\u001B[38;5;241m.\u001B[39mid) \u001B[38;5;28;01mfor\u001B[39;00m match \u001B[38;5;129;01min\u001B[39;00m matches]\n\u001B[1;32m 139\u001B[0m projects_info \u001B[38;5;241m=\u001B[39m [\n\u001B[1;32m 140\u001B[0m (\n\u001B[1;32m 141\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mName: \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mp\u001B[38;5;241m.\u001B[39mname\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m,\u001B[39m\u001B[38;5;130;01m\\t\u001B[39;00m\u001B[38;5;124m Type: \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mp\u001B[38;5;241m.\u001B[39mproject_type\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m,\u001B[39m\u001B[38;5;130;01m\\t\u001B[39;00m\u001B[38;5;124m ID: \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mp\u001B[38;5;241m.\u001B[39mid\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m,\u001B[39m\u001B[38;5;130;01m\\t\u001B[39;00m\u001B[38;5;124m \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[0;32m (...)\u001B[0m\n\u001B[1;32m 144\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m p \u001B[38;5;129;01min\u001B[39;00m detailed_matches\n\u001B[1;32m 145\u001B[0m ]\n\u001B[0;32m--> 146\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mValueError\u001B[39;00m(\n\u001B[1;32m 147\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mA total of \u001B[39m\u001B[38;5;132;01m{\u001B[39;00m\u001B[38;5;28mlen\u001B[39m(matches)\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m projects named `\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mproject_name\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m` were \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 148\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mfound in the workspace. Unable to uniquely identify the \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 149\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mdesired project. Please provide a `project_id` to ensure the \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 150\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mproper project is returned. The following projects were found:\u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 151\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mprojects_info\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 152\u001B[0m )\n\u001B[1;32m 153\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m 154\u001B[0m warnings\u001B[38;5;241m.\u001B[39mwarn(\n\u001B[1;32m 155\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mProject with name \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mproject_name\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m was not found on the server.\u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 156\u001B[0m )\n", + "\u001B[0;31mValueError\u001B[0m: A total of 2 projects named `Segmentation demo` were found in the workspace. Unable to uniquely identify the desired project. Please provide a `project_id` to ensure the proper project is returned. The following projects were found:['Name: Segmentation demo,\\t Type: segmentation,\\t ID: 673e02f8f57f93285cef276c,\\t creation_date: 2024-11-20 15:40:40.217000+00:00\\n', 'Name: Segmentation demo,\\t Type: segmentation,\\t ID: 673e0204f57f93285cef2726,\\t creation_date: 2024-11-20 15:36:37.464000+00:00\\n']" + ] + } + ], + "execution_count": 76 }, { "cell_type": "markdown", @@ -250,10 +415,13 @@ }, { "cell_type": "code", - "execution_count": null, "id": "9c20a99c-07b6-4cc2-87fa-abf0ba210031", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:42:02.938169Z", + "start_time": "2024-11-20T15:42:02.935176Z" + } + }, "source": [ "PIPELINE_PROJECT_NAME = \"Detection to hierarchical classification demo\"\n", "PIPELINE_PROJECT_TYPE = \"detection_to_classification\"\n", @@ -270,21 +438,36 @@ " {\"name\": \"school bus\", \"parent_id\": \"bus\", \"group\": \"bus\"},\n", " ],\n", "]" - ] + ], + "outputs": [], + "execution_count": 88 }, { "cell_type": "code", - "execution_count": null, "id": "01d01757-035c-4690-86f0-2f40487a6c52", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:42:03.632038Z", + "start_time": "2024-11-20T15:42:02.957541Z" + } + }, "source": [ "pipeline_project = project_client.create_project(\n", " project_name=PIPELINE_PROJECT_NAME,\n", " project_type=PIPELINE_PROJECT_TYPE,\n", " labels=PIPELINE_LABELS,\n", ")" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2024-11-20 16:42:03,357 - INFO - Project created successfully.\n" + ] + } + ], + "execution_count": 89 }, { "cell_type": "markdown", @@ -296,13 +479,31 @@ }, { "cell_type": "code", - "execution_count": null, "id": "71a5b21f-edf6-4be4-8e86-08db768040f2", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:42:03.642724Z", + "start_time": "2024-11-20T15:42:03.640665Z" + } + }, "source": [ "print(pipeline_project.summary)" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Project: Detection to hierarchical classification demo\n", + " Task 1: Detection task\n", + " Labels: ['vehicle', 'No object']\n", + " Task 2: Classification task\n", + " Labels: ['car', 'taxi', 'pick-up', 'sports car', 'truck', 'bus', 'van', 'school bus']\n", + "\n" + ] + } + ], + "execution_count": 90 }, { "cell_type": "markdown", @@ -314,13 +515,98 @@ }, { "cell_type": "code", - "execution_count": null, "id": "d23f29b8-056d-476a-a244-5f7355e00743", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:42:03.660071Z", + "start_time": "2024-11-20T15:42:03.656606Z" + } + }, "source": [ "print(pipeline_project.overview)" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'datasets': [{'name': 'Dataset', 'use_for_training': True}],\n", + " 'name': 'Detection to hierarchical classification demo',\n", + " 'performance': {'task_performances': [{'task_id': '673e034bf57f93285cef27b5'},\n", + " {'task_id': '673e034bf57f93285cef27ba'}]},\n", + " 'pipeline': {'connections': [{'from': 'Dataset', 'to': 'Detection task'},\n", + " {'from': 'Detection task', 'to': 'Crop task'},\n", + " {'from': 'Crop task',\n", + " 'to': 'Classification task'}],\n", + " 'tasks': [{'task_type': 'dataset', 'title': 'Dataset'},\n", + " {'labels': [{'color': '#ffffffff',\n", + " 'group': 'detection task label group',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'vehicle'},\n", + " {'color': '#000000ff',\n", + " 'group': 'No object',\n", + " 'is_anomalous': False,\n", + " 'is_empty': True,\n", + " 'name': 'No object'}],\n", + " 'task_type': 'detection',\n", + " 'title': 'Detection task'},\n", + " {'task_type': 'crop', 'title': 'Crop task'},\n", + " {'labels': [{'color': '#ffffffff',\n", + " 'group': 'classification task label group',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'car',\n", + " 'parent_id': 'vehicle'},\n", + " {'color': '#ffffffff',\n", + " 'group': 'car',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'taxi',\n", + " 'parent_id': 'car'},\n", + " {'color': '#ffffffff',\n", + " 'group': 'car',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'pick-up',\n", + " 'parent_id': 'car'},\n", + " {'color': '#ffffffff',\n", + " 'group': 'car',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'sports car',\n", + " 'parent_id': 'car'},\n", + " {'color': '#ffffffff',\n", + " 'group': 'classification task label group',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'truck',\n", + " 'parent_id': 'vehicle'},\n", + " {'color': '#ffffffff',\n", + " 'group': 'classification task label group',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'bus',\n", + " 'parent_id': 'vehicle'},\n", + " {'color': '#ffffffff',\n", + " 'group': 'bus',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'van',\n", + " 'parent_id': 'bus'},\n", + " {'color': '#ffffffff',\n", + " 'group': 'bus',\n", + " 'is_anomalous': False,\n", + " 'is_empty': False,\n", + " 'name': 'school bus',\n", + " 'parent_id': 'bus'}],\n", + " 'task_type': 'classification',\n", + " 'title': 'Classification task'}]},\n", + " 'storage_info': {}}\n" + ] + } + ], + "execution_count": 91 }, { "cell_type": "markdown", @@ -339,15 +625,20 @@ }, { "cell_type": "code", - "execution_count": null, "id": "e2a2548a-8f84-4395-bdf7-8a4ebf3447a3", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:42:03.669615Z", + "start_time": "2024-11-20T15:42:03.668029Z" + } + }, "source": [ "# Delete the simple project\n", "\n", "# project_client.delete_project(project)" - ] + ], + "outputs": [], + "execution_count": 92 }, { "cell_type": "markdown", @@ -361,14 +652,36 @@ }, { "cell_type": "code", - "execution_count": null, "id": "ab209bce-5195-4f40-9d40-032af0bb5031", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-20T15:42:03.857462Z", + "start_time": "2024-11-20T15:42:03.679525Z" + } + }, "source": [ "# Delete the pipeline project\n", - "project_client.delete_project(pipeline_project, requires_confirmation=False)" - ] + "\n", + "# project_client.delete_project(pipeline_project, requires_confirmation=False)" + ], + "outputs": [ + { + "ename": "GetiRequestException", + "evalue": "DELETE request to 'https://10-55-252-41.iotg.sclab.intel.com/api/v1/organizations/6c0a38b5-af1e-4167-810d-449aff2f92a5/workspaces/c33609cf-4e3f-4f6b-b464-1671ed4543c9/projects/673e034bf57f93285cef27b2' failed with status code 403.", + "output_type": "error", + "traceback": [ + "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[0;31mGetiRequestException\u001B[0m Traceback (most recent call last)", + "Cell \u001B[0;32mIn[93], line 2\u001B[0m\n\u001B[1;32m 1\u001B[0m \u001B[38;5;66;03m# Delete the pipeline project\u001B[39;00m\n\u001B[0;32m----> 2\u001B[0m \u001B[43mproject_client\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mdelete_project\u001B[49m\u001B[43m(\u001B[49m\u001B[43mpipeline_project\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mrequires_confirmation\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;28;43;01mFalse\u001B[39;49;00m\u001B[43m)\u001B[49m\n", + "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/rest_clients/project_client/project_client.py:554\u001B[0m, in \u001B[0;36mProjectClient.delete_project\u001B[0;34m(self, project, requires_confirmation)\u001B[0m\n\u001B[1;32m 548\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mValueError\u001B[39;00m(\n\u001B[1;32m 549\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mProject \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mproject\u001B[38;5;241m.\u001B[39mname\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m is locked for deletion/modification. \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 550\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mPlease wait until all jobs related to this project are finished \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 551\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mor cancel them to allow deletion/modification.\u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 552\u001B[0m )\n\u001B[1;32m 553\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[0;32m--> 554\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m error\n\u001B[1;32m 555\u001B[0m logging\u001B[38;5;241m.\u001B[39minfo(\u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mProject \u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mproject\u001B[38;5;241m.\u001B[39mname\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124m deleted successfully.\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n", + "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/rest_clients/project_client/project_client.py:543\u001B[0m, in \u001B[0;36mProjectClient.delete_project\u001B[0;34m(self, project, requires_confirmation)\u001B[0m\n\u001B[1;32m 541\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m\n\u001B[1;32m 542\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[0;32m--> 543\u001B[0m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43msession\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_rest_response\u001B[49m\u001B[43m(\u001B[49m\n\u001B[1;32m 544\u001B[0m \u001B[43m \u001B[49m\u001B[43murl\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43mf\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[38;5;132;43;01m{\u001B[39;49;00m\u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mbase_url\u001B[49m\u001B[38;5;132;43;01m}\u001B[39;49;00m\u001B[38;5;124;43mprojects/\u001B[39;49m\u001B[38;5;132;43;01m{\u001B[39;49;00m\u001B[43mproject\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mid\u001B[49m\u001B[38;5;132;43;01m}\u001B[39;49;00m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmethod\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[38;5;124;43mDELETE\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\n\u001B[1;32m 545\u001B[0m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 546\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m GetiRequestException \u001B[38;5;28;01mas\u001B[39;00m error:\n\u001B[1;32m 547\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m error\u001B[38;5;241m.\u001B[39mstatus_code \u001B[38;5;241m==\u001B[39m \u001B[38;5;241m409\u001B[39m:\n", + "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/http_session/geti_session.py:334\u001B[0m, in \u001B[0;36mGetiSession.get_rest_response\u001B[0;34m(self, url, method, contenttype, data, allow_reauthentication, include_organization_id, allow_text_response, request_headers)\u001B[0m\n\u001B[1;32m 330\u001B[0m response_content_type \u001B[38;5;241m=\u001B[39m response\u001B[38;5;241m.\u001B[39mheaders\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mContent-Type\u001B[39m\u001B[38;5;124m\"\u001B[39m, [])\n\u001B[1;32m 331\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m response\u001B[38;5;241m.\u001B[39mstatus_code \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;129;01min\u001B[39;00m SUCCESS_STATUS_CODES \u001B[38;5;129;01mor\u001B[39;00m (\n\u001B[1;32m 332\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mtext/html\u001B[39m\u001B[38;5;124m\"\u001B[39m \u001B[38;5;129;01min\u001B[39;00m response_content_type \u001B[38;5;129;01mand\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m allow_text_response\n\u001B[1;32m 333\u001B[0m ):\n\u001B[0;32m--> 334\u001B[0m response \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_handle_error_response\u001B[49m\u001B[43m(\u001B[49m\n\u001B[1;32m 335\u001B[0m \u001B[43m \u001B[49m\u001B[43mresponse\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mresponse\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 336\u001B[0m \u001B[43m \u001B[49m\u001B[43mrequest_params\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mrequest_params\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 337\u001B[0m \u001B[43m \u001B[49m\u001B[43mrequest_data\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mkw_data_arg\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 338\u001B[0m \u001B[43m \u001B[49m\u001B[43mallow_reauthentication\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mallow_reauthentication\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 339\u001B[0m \u001B[43m \u001B[49m\u001B[43mcontent_type\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mcontenttype\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 340\u001B[0m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 341\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m response\u001B[38;5;241m.\u001B[39mheaders\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mContent-Type\u001B[39m\u001B[38;5;124m\"\u001B[39m, \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124m\"\u001B[39m)\u001B[38;5;241m.\u001B[39mstartswith(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mapplication/json\u001B[39m\u001B[38;5;124m\"\u001B[39m):\n\u001B[1;32m 342\u001B[0m result \u001B[38;5;241m=\u001B[39m response\u001B[38;5;241m.\u001B[39mjson()\n", + "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/http_session/geti_session.py:510\u001B[0m, in \u001B[0;36mGetiSession._handle_error_response\u001B[0;34m(self, response, request_params, request_data, allow_reauthentication, content_type)\u001B[0m\n\u001B[1;32m 507\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m (JSONDecodeError, simplejson\u001B[38;5;241m.\u001B[39merrors\u001B[38;5;241m.\u001B[39mJSONDecodeError):\n\u001B[1;32m 508\u001B[0m response_data \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;01mNone\u001B[39;00m\n\u001B[0;32m--> 510\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m GetiRequestException(\n\u001B[1;32m 511\u001B[0m method\u001B[38;5;241m=\u001B[39mrequest_params[\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mmethod\u001B[39m\u001B[38;5;124m\"\u001B[39m],\n\u001B[1;32m 512\u001B[0m url\u001B[38;5;241m=\u001B[39mrequest_params[\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124murl\u001B[39m\u001B[38;5;124m\"\u001B[39m],\n\u001B[1;32m 513\u001B[0m status_code\u001B[38;5;241m=\u001B[39mresponse\u001B[38;5;241m.\u001B[39mstatus_code,\n\u001B[1;32m 514\u001B[0m request_data\u001B[38;5;241m=\u001B[39mrequest_data,\n\u001B[1;32m 515\u001B[0m response_data\u001B[38;5;241m=\u001B[39mresponse_data,\n\u001B[1;32m 516\u001B[0m )\n", + "\u001B[0;31mGetiRequestException\u001B[0m: DELETE request to 'https://10-55-252-41.iotg.sclab.intel.com/api/v1/organizations/6c0a38b5-af1e-4167-810d-449aff2f92a5/workspaces/c33609cf-4e3f-4f6b-b464-1671ed4543c9/projects/673e034bf57f93285cef27b2' failed with status code 403." + ] + } + ], + "execution_count": 93 }, { "cell_type": "code", From 749634096ac4b455681fa231838d9edff6489d50 Mon Sep 17 00:00:00 2001 From: Daan Krol Date: Thu, 21 Nov 2024 11:22:52 +0100 Subject: [PATCH 2/2] cleanup --- notebooks/001_create_project.ipynb | 402 ++++------------------------- 1 file changed, 45 insertions(+), 357 deletions(-) diff --git a/notebooks/001_create_project.ipynb b/notebooks/001_create_project.ipynb index 0dedcf2d..425b6920 100644 --- a/notebooks/001_create_project.ipynb +++ b/notebooks/001_create_project.ipynb @@ -15,19 +15,14 @@ { "cell_type": "code", "id": "3cb49dd2-7032-40e0-a4c2-8203ba1072bf", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:40:38.773121Z", - "start_time": "2024-11-20T15:40:38.769997Z" - } - }, + "metadata": {}, "source": [ "from geti_sdk.utils import get_server_details_from_env\n", "\n", "geti_server_configuration = get_server_details_from_env()" ], "outputs": [], - "execution_count": 67 + "execution_count": null }, { "cell_type": "markdown", @@ -40,19 +35,14 @@ { "cell_type": "code", "id": "ba8318f4-3d97-4949-abf0-6cdafe46572e", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:40:39.315746Z", - "start_time": "2024-11-20T15:40:38.776172Z" - } - }, + "metadata": {}, "source": [ "from geti_sdk import Geti\n", "\n", "geti = Geti(server_config=geti_server_configuration)" ], "outputs": [], - "execution_count": 68 + "execution_count": null }, { "cell_type": "markdown", @@ -66,12 +56,7 @@ { "cell_type": "code", "id": "081e700d-9e2e-4022-b4d6-dac3adf1d4f8", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:40:39.940011Z", - "start_time": "2024-11-20T15:40:39.327053Z" - } - }, + "metadata": {}, "source": [ "from geti_sdk.rest_clients import ProjectClient\n", "\n", @@ -79,22 +64,8 @@ "\n", "projects = project_client.list_projects()" ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1 projects were found on the platform:\n", - "\n", - " Project: Segmentation demo\n", - " Task 1: Segmentation task\n", - " Labels: ['dog', 'cat', 'horse', 'Empty']\n", - "\n", - "\n" - ] - } - ], - "execution_count": 69 + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -119,12 +90,7 @@ { "cell_type": "code", "id": "30e46136-5283-4e3d-8dcf-7a89bee4de6b", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:40:39.963221Z", - "start_time": "2024-11-20T15:40:39.961033Z" - } - }, + "metadata": {}, "source": [ "from geti_sdk.data_models.enums import TaskType\n", "\n", @@ -134,25 +100,8 @@ " if task_type.is_trainable:\n", " print(\" \" + str(task_type))" ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Supported task types:\n", - " detection\n", - " segmentation\n", - " classification\n", - " anomaly_classification\n", - " anomaly_detection\n", - " anomaly_segmentation\n", - " anomaly\n", - " instance_segmentation\n", - " rotated_detection\n" - ] - } - ], - "execution_count": 70 + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -190,12 +139,7 @@ { "cell_type": "code", "id": "b18c25d1-f53b-495e-a48e-ee89b7f95d4e", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:40:39.978450Z", - "start_time": "2024-11-20T15:40:39.976701Z" - } - }, + "metadata": {}, "source": [ "# First set the project parameters. Feel free to experiment here!\n", "PROJECT_NAME = \"Segmentation demo\"\n", @@ -203,33 +147,20 @@ "LABELS = [[\"dog\", \"cat\", \"horse\"]]" ], "outputs": [], - "execution_count": 71 + "execution_count": null }, { "cell_type": "code", "id": "4941f712-f97b-48ff-a11b-74687d0bb49f", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:40:40.600445Z", - "start_time": "2024-11-20T15:40:39.993833Z" - } - }, + "metadata": {}, "source": [ "# Now, use the project client to create the project\n", "project = project_client.create_project(\n", " project_name=PROJECT_NAME, project_type=PROJECT_TYPE, labels=LABELS\n", ")" ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2024-11-20 16:40:40,357 - INFO - Project created successfully.\n" - ] - } - ], - "execution_count": 72 + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -243,28 +174,12 @@ { "cell_type": "code", "id": "c9d3496b-663d-41d3-b381-5e05b4c8e5b0", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:40:40.610576Z", - "start_time": "2024-11-20T15:40:40.608611Z" - } - }, + "metadata": {}, "source": [ "print(project.summary)" ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Project: Segmentation demo\n", - " Task 1: Segmentation task\n", - " Labels: ['dog', 'cat', 'horse', 'Empty']\n", - "\n" - ] - } - ], - "execution_count": 73 + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -277,52 +192,12 @@ { "cell_type": "code", "id": "8786e8df-3ecb-4947-ad71-c8512e0b22ac", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:40:40.630251Z", - "start_time": "2024-11-20T15:40:40.627690Z" - } - }, + "metadata": {}, "source": [ "print(project.overview)" ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'datasets': [{'name': 'Dataset', 'use_for_training': True}],\n", - " 'name': 'Segmentation demo',\n", - " 'performance': {'task_performances': [{'task_id': '673e02f8f57f93285cef276f'}]},\n", - " 'pipeline': {'connections': [{'from': 'Dataset', 'to': 'Segmentation task'}],\n", - " 'tasks': [{'task_type': 'dataset', 'title': 'Dataset'},\n", - " {'labels': [{'color': '#ffffffff',\n", - " 'group': 'segmentation task label group',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'dog'},\n", - " {'color': '#ffffffff',\n", - " 'group': 'segmentation task label group',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'cat'},\n", - " {'color': '#ffffffff',\n", - " 'group': 'segmentation task label group',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'horse'},\n", - " {'color': '#000000ff',\n", - " 'group': 'Empty',\n", - " 'is_anomalous': False,\n", - " 'is_empty': True,\n", - " 'name': 'Empty'}],\n", - " 'task_type': 'segmentation',\n", - " 'title': 'Segmentation task'}]},\n", - " 'storage_info': {}}\n" - ] - } - ], - "execution_count": 74 + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -335,36 +210,15 @@ { "cell_type": "code", "id": "01cb2ee6-9d45-4d17-aa6f-2ac0330ce369", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:40:40.649417Z", - "start_time": "2024-11-20T15:40:40.647367Z" - } - }, + "metadata": {}, "source": [ "task_list = project.get_trainable_tasks()\n", "print(f\"Project '{project.name}' contains {len(task_list)} trainable tasks.\")\n", "for task in task_list:\n", " print(task.summary)" ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Project 'Segmentation demo' contains 1 trainable tasks.\n", - "Task: Segmentation task\n", - " Type: segmentation \n", - " Labels:\n", - " Name: dog, Group: segmentation task label group, Parent: None\n", - " Name: cat, Group: segmentation task label group, Parent: None\n", - " Name: horse, Group: segmentation task label group, Parent: None\n", - " Name: Empty, Group: Empty, Parent: None\n", - "\n" - ] - } - ], - "execution_count": 75 + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -377,32 +231,13 @@ { "cell_type": "code", "id": "71dbcca8-b79e-441d-9143-091c2b08ba35", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:40:41.401583Z", - "start_time": "2024-11-20T15:40:40.673069Z" - } - }, + "metadata": {}, "source": [ "project = project_client.get_project(project_name=PROJECT_NAME)\n", "print(project.summary)" ], - "outputs": [ - { - "ename": "ValueError", - "evalue": "A total of 2 projects named `Segmentation demo` were found in the workspace. Unable to uniquely identify the desired project. Please provide a `project_id` to ensure the proper project is returned. The following projects were found:['Name: Segmentation demo,\\t Type: segmentation,\\t ID: 673e02f8f57f93285cef276c,\\t creation_date: 2024-11-20 15:40:40.217000+00:00\\n', 'Name: Segmentation demo,\\t Type: segmentation,\\t ID: 673e0204f57f93285cef2726,\\t creation_date: 2024-11-20 15:36:37.464000+00:00\\n']", - "output_type": "error", - "traceback": [ - "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", - "\u001B[0;31mValueError\u001B[0m Traceback (most recent call last)", - "Cell \u001B[0;32mIn[76], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m project \u001B[38;5;241m=\u001B[39m \u001B[43mproject_client\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_project\u001B[49m\u001B[43m(\u001B[49m\u001B[43mproject_name\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mPROJECT_NAME\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 2\u001B[0m \u001B[38;5;28mprint\u001B[39m(project\u001B[38;5;241m.\u001B[39msummary)\n", - "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/rest_clients/project_client/project_client.py:714\u001B[0m, in \u001B[0;36mProjectClient.get_project\u001B[0;34m(self, project_name, project_id, project)\u001B[0m\n\u001B[1;32m 712\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mget_project_by_name(project_name\u001B[38;5;241m=\u001B[39mproject\u001B[38;5;241m.\u001B[39mname)\n\u001B[1;32m 713\u001B[0m \u001B[38;5;28;01melif\u001B[39;00m project_name \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[0;32m--> 714\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_project_by_name\u001B[49m\u001B[43m(\u001B[49m\u001B[43mproject_name\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mproject_name\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 715\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m 716\u001B[0m \u001B[38;5;66;03m# No parameters provided\u001B[39;00m\n\u001B[1;32m 717\u001B[0m \u001B[38;5;66;03m# Warn the user and return None\u001B[39;00m\n\u001B[1;32m 718\u001B[0m warnings\u001B[38;5;241m.\u001B[39mwarn(\n\u001B[1;32m 719\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mAt least one of the parameters `project_name`, `project_id`, or \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 720\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124m`project` must be provided.\u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 721\u001B[0m )\n", - "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/rest_clients/project_client/project_client.py:146\u001B[0m, in \u001B[0;36mProjectClient.get_project_by_name\u001B[0;34m(self, project_name)\u001B[0m\n\u001B[1;32m 138\u001B[0m detailed_matches \u001B[38;5;241m=\u001B[39m [\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mget_project_by_id(match\u001B[38;5;241m.\u001B[39mid) \u001B[38;5;28;01mfor\u001B[39;00m match \u001B[38;5;129;01min\u001B[39;00m matches]\n\u001B[1;32m 139\u001B[0m projects_info \u001B[38;5;241m=\u001B[39m [\n\u001B[1;32m 140\u001B[0m (\n\u001B[1;32m 141\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mName: \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mp\u001B[38;5;241m.\u001B[39mname\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m,\u001B[39m\u001B[38;5;130;01m\\t\u001B[39;00m\u001B[38;5;124m Type: \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mp\u001B[38;5;241m.\u001B[39mproject_type\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m,\u001B[39m\u001B[38;5;130;01m\\t\u001B[39;00m\u001B[38;5;124m ID: \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mp\u001B[38;5;241m.\u001B[39mid\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m,\u001B[39m\u001B[38;5;130;01m\\t\u001B[39;00m\u001B[38;5;124m \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[0;32m (...)\u001B[0m\n\u001B[1;32m 144\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m p \u001B[38;5;129;01min\u001B[39;00m detailed_matches\n\u001B[1;32m 145\u001B[0m ]\n\u001B[0;32m--> 146\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mValueError\u001B[39;00m(\n\u001B[1;32m 147\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mA total of \u001B[39m\u001B[38;5;132;01m{\u001B[39;00m\u001B[38;5;28mlen\u001B[39m(matches)\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m projects named `\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mproject_name\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m` were \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 148\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mfound in the workspace. Unable to uniquely identify the \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 149\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mdesired project. Please provide a `project_id` to ensure the \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 150\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mproper project is returned. The following projects were found:\u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 151\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mprojects_info\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 152\u001B[0m )\n\u001B[1;32m 153\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m 154\u001B[0m warnings\u001B[38;5;241m.\u001B[39mwarn(\n\u001B[1;32m 155\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mProject with name \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mproject_name\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m was not found on the server.\u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 156\u001B[0m )\n", - "\u001B[0;31mValueError\u001B[0m: A total of 2 projects named `Segmentation demo` were found in the workspace. Unable to uniquely identify the desired project. Please provide a `project_id` to ensure the proper project is returned. The following projects were found:['Name: Segmentation demo,\\t Type: segmentation,\\t ID: 673e02f8f57f93285cef276c,\\t creation_date: 2024-11-20 15:40:40.217000+00:00\\n', 'Name: Segmentation demo,\\t Type: segmentation,\\t ID: 673e0204f57f93285cef2726,\\t creation_date: 2024-11-20 15:36:37.464000+00:00\\n']" - ] - } - ], - "execution_count": 76 + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -416,12 +251,7 @@ { "cell_type": "code", "id": "9c20a99c-07b6-4cc2-87fa-abf0ba210031", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:42:02.938169Z", - "start_time": "2024-11-20T15:42:02.935176Z" - } - }, + "metadata": {}, "source": [ "PIPELINE_PROJECT_NAME = \"Detection to hierarchical classification demo\"\n", "PIPELINE_PROJECT_TYPE = \"detection_to_classification\"\n", @@ -440,17 +270,12 @@ "]" ], "outputs": [], - "execution_count": 88 + "execution_count": null }, { "cell_type": "code", "id": "01d01757-035c-4690-86f0-2f40487a6c52", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:42:03.632038Z", - "start_time": "2024-11-20T15:42:02.957541Z" - } - }, + "metadata": {}, "source": [ "pipeline_project = project_client.create_project(\n", " project_name=PIPELINE_PROJECT_NAME,\n", @@ -458,16 +283,8 @@ " labels=PIPELINE_LABELS,\n", ")" ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2024-11-20 16:42:03,357 - INFO - Project created successfully.\n" - ] - } - ], - "execution_count": 89 + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -480,30 +297,12 @@ { "cell_type": "code", "id": "71a5b21f-edf6-4be4-8e86-08db768040f2", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:42:03.642724Z", - "start_time": "2024-11-20T15:42:03.640665Z" - } - }, + "metadata": {}, "source": [ "print(pipeline_project.summary)" ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Project: Detection to hierarchical classification demo\n", - " Task 1: Detection task\n", - " Labels: ['vehicle', 'No object']\n", - " Task 2: Classification task\n", - " Labels: ['car', 'taxi', 'pick-up', 'sports car', 'truck', 'bus', 'van', 'school bus']\n", - "\n" - ] - } - ], - "execution_count": 90 + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -516,97 +315,12 @@ { "cell_type": "code", "id": "d23f29b8-056d-476a-a244-5f7355e00743", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:42:03.660071Z", - "start_time": "2024-11-20T15:42:03.656606Z" - } - }, + "metadata": {}, "source": [ "print(pipeline_project.overview)" ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'datasets': [{'name': 'Dataset', 'use_for_training': True}],\n", - " 'name': 'Detection to hierarchical classification demo',\n", - " 'performance': {'task_performances': [{'task_id': '673e034bf57f93285cef27b5'},\n", - " {'task_id': '673e034bf57f93285cef27ba'}]},\n", - " 'pipeline': {'connections': [{'from': 'Dataset', 'to': 'Detection task'},\n", - " {'from': 'Detection task', 'to': 'Crop task'},\n", - " {'from': 'Crop task',\n", - " 'to': 'Classification task'}],\n", - " 'tasks': [{'task_type': 'dataset', 'title': 'Dataset'},\n", - " {'labels': [{'color': '#ffffffff',\n", - " 'group': 'detection task label group',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'vehicle'},\n", - " {'color': '#000000ff',\n", - " 'group': 'No object',\n", - " 'is_anomalous': False,\n", - " 'is_empty': True,\n", - " 'name': 'No object'}],\n", - " 'task_type': 'detection',\n", - " 'title': 'Detection task'},\n", - " {'task_type': 'crop', 'title': 'Crop task'},\n", - " {'labels': [{'color': '#ffffffff',\n", - " 'group': 'classification task label group',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'car',\n", - " 'parent_id': 'vehicle'},\n", - " {'color': '#ffffffff',\n", - " 'group': 'car',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'taxi',\n", - " 'parent_id': 'car'},\n", - " {'color': '#ffffffff',\n", - " 'group': 'car',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'pick-up',\n", - " 'parent_id': 'car'},\n", - " {'color': '#ffffffff',\n", - " 'group': 'car',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'sports car',\n", - " 'parent_id': 'car'},\n", - " {'color': '#ffffffff',\n", - " 'group': 'classification task label group',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'truck',\n", - " 'parent_id': 'vehicle'},\n", - " {'color': '#ffffffff',\n", - " 'group': 'classification task label group',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'bus',\n", - " 'parent_id': 'vehicle'},\n", - " {'color': '#ffffffff',\n", - " 'group': 'bus',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'van',\n", - " 'parent_id': 'bus'},\n", - " {'color': '#ffffffff',\n", - " 'group': 'bus',\n", - " 'is_anomalous': False,\n", - " 'is_empty': False,\n", - " 'name': 'school bus',\n", - " 'parent_id': 'bus'}],\n", - " 'task_type': 'classification',\n", - " 'title': 'Classification task'}]},\n", - " 'storage_info': {}}\n" - ] - } - ], - "execution_count": 91 + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -626,19 +340,14 @@ { "cell_type": "code", "id": "e2a2548a-8f84-4395-bdf7-8a4ebf3447a3", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:42:03.669615Z", - "start_time": "2024-11-20T15:42:03.668029Z" - } - }, + "metadata": {}, "source": [ "# Delete the simple project\n", "\n", "# project_client.delete_project(project)" ], "outputs": [], - "execution_count": 92 + "execution_count": null }, { "cell_type": "markdown", @@ -653,43 +362,22 @@ { "cell_type": "code", "id": "ab209bce-5195-4f40-9d40-032af0bb5031", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-20T15:42:03.857462Z", - "start_time": "2024-11-20T15:42:03.679525Z" - } - }, + "metadata": {}, "source": [ "# Delete the pipeline project\n", "\n", "# project_client.delete_project(pipeline_project, requires_confirmation=False)" ], - "outputs": [ - { - "ename": "GetiRequestException", - "evalue": "DELETE request to 'https://10-55-252-41.iotg.sclab.intel.com/api/v1/organizations/6c0a38b5-af1e-4167-810d-449aff2f92a5/workspaces/c33609cf-4e3f-4f6b-b464-1671ed4543c9/projects/673e034bf57f93285cef27b2' failed with status code 403.", - "output_type": "error", - "traceback": [ - "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", - "\u001B[0;31mGetiRequestException\u001B[0m Traceback (most recent call last)", - "Cell \u001B[0;32mIn[93], line 2\u001B[0m\n\u001B[1;32m 1\u001B[0m \u001B[38;5;66;03m# Delete the pipeline project\u001B[39;00m\n\u001B[0;32m----> 2\u001B[0m \u001B[43mproject_client\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mdelete_project\u001B[49m\u001B[43m(\u001B[49m\u001B[43mpipeline_project\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mrequires_confirmation\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;28;43;01mFalse\u001B[39;49;00m\u001B[43m)\u001B[49m\n", - "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/rest_clients/project_client/project_client.py:554\u001B[0m, in \u001B[0;36mProjectClient.delete_project\u001B[0;34m(self, project, requires_confirmation)\u001B[0m\n\u001B[1;32m 548\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mValueError\u001B[39;00m(\n\u001B[1;32m 549\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mProject \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mproject\u001B[38;5;241m.\u001B[39mname\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m is locked for deletion/modification. \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 550\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mPlease wait until all jobs related to this project are finished \u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 551\u001B[0m \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mor cancel them to allow deletion/modification.\u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 552\u001B[0m )\n\u001B[1;32m 553\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[0;32m--> 554\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m error\n\u001B[1;32m 555\u001B[0m logging\u001B[38;5;241m.\u001B[39minfo(\u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mProject \u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mproject\u001B[38;5;241m.\u001B[39mname\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124m deleted successfully.\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n", - "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/rest_clients/project_client/project_client.py:543\u001B[0m, in \u001B[0;36mProjectClient.delete_project\u001B[0;34m(self, project, requires_confirmation)\u001B[0m\n\u001B[1;32m 541\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m\n\u001B[1;32m 542\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[0;32m--> 543\u001B[0m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43msession\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_rest_response\u001B[49m\u001B[43m(\u001B[49m\n\u001B[1;32m 544\u001B[0m \u001B[43m \u001B[49m\u001B[43murl\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43mf\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[38;5;132;43;01m{\u001B[39;49;00m\u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mbase_url\u001B[49m\u001B[38;5;132;43;01m}\u001B[39;49;00m\u001B[38;5;124;43mprojects/\u001B[39;49m\u001B[38;5;132;43;01m{\u001B[39;49;00m\u001B[43mproject\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mid\u001B[49m\u001B[38;5;132;43;01m}\u001B[39;49;00m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmethod\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[38;5;124;43mDELETE\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\n\u001B[1;32m 545\u001B[0m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 546\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m GetiRequestException \u001B[38;5;28;01mas\u001B[39;00m error:\n\u001B[1;32m 547\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m error\u001B[38;5;241m.\u001B[39mstatus_code \u001B[38;5;241m==\u001B[39m \u001B[38;5;241m409\u001B[39m:\n", - "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/http_session/geti_session.py:334\u001B[0m, in \u001B[0;36mGetiSession.get_rest_response\u001B[0;34m(self, url, method, contenttype, data, allow_reauthentication, include_organization_id, allow_text_response, request_headers)\u001B[0m\n\u001B[1;32m 330\u001B[0m response_content_type \u001B[38;5;241m=\u001B[39m response\u001B[38;5;241m.\u001B[39mheaders\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mContent-Type\u001B[39m\u001B[38;5;124m\"\u001B[39m, [])\n\u001B[1;32m 331\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m response\u001B[38;5;241m.\u001B[39mstatus_code \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;129;01min\u001B[39;00m SUCCESS_STATUS_CODES \u001B[38;5;129;01mor\u001B[39;00m (\n\u001B[1;32m 332\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mtext/html\u001B[39m\u001B[38;5;124m\"\u001B[39m \u001B[38;5;129;01min\u001B[39;00m response_content_type \u001B[38;5;129;01mand\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m allow_text_response\n\u001B[1;32m 333\u001B[0m ):\n\u001B[0;32m--> 334\u001B[0m response \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_handle_error_response\u001B[49m\u001B[43m(\u001B[49m\n\u001B[1;32m 335\u001B[0m \u001B[43m \u001B[49m\u001B[43mresponse\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mresponse\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 336\u001B[0m \u001B[43m \u001B[49m\u001B[43mrequest_params\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mrequest_params\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 337\u001B[0m \u001B[43m \u001B[49m\u001B[43mrequest_data\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mkw_data_arg\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 338\u001B[0m \u001B[43m \u001B[49m\u001B[43mallow_reauthentication\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mallow_reauthentication\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 339\u001B[0m \u001B[43m \u001B[49m\u001B[43mcontent_type\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mcontenttype\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 340\u001B[0m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 341\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m response\u001B[38;5;241m.\u001B[39mheaders\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mContent-Type\u001B[39m\u001B[38;5;124m\"\u001B[39m, \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124m\"\u001B[39m)\u001B[38;5;241m.\u001B[39mstartswith(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mapplication/json\u001B[39m\u001B[38;5;124m\"\u001B[39m):\n\u001B[1;32m 342\u001B[0m result \u001B[38;5;241m=\u001B[39m response\u001B[38;5;241m.\u001B[39mjson()\n", - "File \u001B[0;32m~/PycharmProjects/geti-sdk-upload-speed/geti-sdk/geti_sdk/http_session/geti_session.py:510\u001B[0m, in \u001B[0;36mGetiSession._handle_error_response\u001B[0;34m(self, response, request_params, request_data, allow_reauthentication, content_type)\u001B[0m\n\u001B[1;32m 507\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m (JSONDecodeError, simplejson\u001B[38;5;241m.\u001B[39merrors\u001B[38;5;241m.\u001B[39mJSONDecodeError):\n\u001B[1;32m 508\u001B[0m response_data \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;01mNone\u001B[39;00m\n\u001B[0;32m--> 510\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m GetiRequestException(\n\u001B[1;32m 511\u001B[0m method\u001B[38;5;241m=\u001B[39mrequest_params[\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mmethod\u001B[39m\u001B[38;5;124m\"\u001B[39m],\n\u001B[1;32m 512\u001B[0m url\u001B[38;5;241m=\u001B[39mrequest_params[\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124murl\u001B[39m\u001B[38;5;124m\"\u001B[39m],\n\u001B[1;32m 513\u001B[0m status_code\u001B[38;5;241m=\u001B[39mresponse\u001B[38;5;241m.\u001B[39mstatus_code,\n\u001B[1;32m 514\u001B[0m request_data\u001B[38;5;241m=\u001B[39mrequest_data,\n\u001B[1;32m 515\u001B[0m response_data\u001B[38;5;241m=\u001B[39mresponse_data,\n\u001B[1;32m 516\u001B[0m )\n", - "\u001B[0;31mGetiRequestException\u001B[0m: DELETE request to 'https://10-55-252-41.iotg.sclab.intel.com/api/v1/organizations/6c0a38b5-af1e-4167-810d-449aff2f92a5/workspaces/c33609cf-4e3f-4f6b-b464-1671ed4543c9/projects/673e034bf57f93285cef27b2' failed with status code 403." - ] - } - ], - "execution_count": 93 + "outputs": [], + "execution_count": null }, { "cell_type": "code", - "execution_count": null, "id": "fa885dd0-b669-4c83-b6b2-bbde010144cd", "metadata": {}, + "source": [], "outputs": [], - "source": [] + "execution_count": null } ], "metadata": {