diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cac0187..f470e46 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: rev: v1.11.2 hooks: - id: mypy - args: ["--config=pyproject.toml"] + args: ["--config=pyproject.toml", "--python-version", "3.12"] additional_dependencies: - types-requests - types-aiofiles diff --git a/labellerr/core/datasets/video_dataset.py b/labellerr/core/datasets/video_dataset.py index 6f38301..44a9dcd 100644 --- a/labellerr/core/datasets/video_dataset.py +++ b/labellerr/core/datasets/video_dataset.py @@ -41,9 +41,13 @@ def fetch_files(self, page_size: int = 1000): # print(params) - response = self.client.make_request(url, params, unique_id) + # Fixed: Pass method as first arg, url as second, params as kwarg - # pprint.pprint(response) + response = self.client.make_request( + method="GET", url=url, request_id=unique_id, params=params + ) + # from pprint import pprint + # pprint(response) # Extract files from the response files = response.get("response", {}).get("files", []) @@ -63,12 +67,15 @@ def fetch_files(self, page_size: int = 1000): if not next_search_after or not files: break - print(f"Fetched total: {len(all_file_ids)}") - print(f"Total file IDs extracted: {len(all_file_ids)}") - # return all_file_ids + return all_file_ids + + except Exception as e: + raise LabellerrError(f"Failed to fetch dataset files: {str(e)}") - # Create LabellerrVideoFile instances for each file_id + def _create_labellerrfile_instances(self, all_file_ids: list, project_id: str): + # Create LabellerrVideoFile instances for each file_id + try: video_files = [] print( f"\nCreating LabellerrFile instances for {len(all_file_ids)} files..." @@ -79,7 +86,7 @@ def fetch_files(self, page_size: int = 1000): video_file = LabellerrFile( client=self.client, file_id=file_id, - project_id="self.project_id", # noqa: # todo: ximi we don't have project id here + project_id=project_id, # noqa: # todo: ximi we don't have project id here dataset_id=self.dataset_id, ) video_files.append(video_file) @@ -94,7 +101,7 @@ def fetch_files(self, page_size: int = 1000): except Exception as e: raise LabellerrError(f"Failed to fetch dataset files: {str(e)}") - def download(self): + def download(self, project_id: str): """ Process all video files in the dataset: download frames, create videos, and automatically clean up temporary files. @@ -107,8 +114,13 @@ def download(self): print(f"# Starting batch video processing for dataset: {self.dataset_id}") print(f"{'#'*70}\n") + # Fetch all files ids + all_files_ids = self.fetch_files() + # Fetch all video files - video_files = self.fetch_files() + video_files = self._create_labellerrfile_instances( + all_files_ids, project_id + ) if not video_files: print("No video files found in dataset") diff --git a/labellerr/core/files/video_file.py b/labellerr/core/files/video_file.py index 7e544d5..1a59234 100644 --- a/labellerr/core/files/video_file.py +++ b/labellerr/core/files/video_file.py @@ -61,9 +61,12 @@ def get_frames(self, frame_start: int = 0, frame_end: int | None = None): "frame_end": frame_end, "project_id": self.project_id, "uuid": unique_id, + "client_id": self.client.client_id, } - response = self.client.make_request(url, params, unique_id) + response = self.client.make_request( + "GET", url, request_id=unique_id, params=params + ) return response @@ -233,7 +236,7 @@ def create_video( raise LabellerrError(f"Error while joining frames: {str(e)}") def download_create_video_auto_cleanup( - self, output_folder: str = "./Labellerr_datastets" + self, output_folder: str = "./Labellerr_datasets" ): """ Download frames, create video, and automatically clean up temporary frames. diff --git a/labellerr/notebooks/SDK.ipynb b/labellerr/notebooks/SDK.ipynb index 1efd28f..20cba96 100644 --- a/labellerr/notebooks/SDK.ipynb +++ b/labellerr/notebooks/SDK.ipynb @@ -22,6 +22,7 @@ "source": [ "from labellerr.client import LabellerrClient\n", "from labellerr.core.datasets import LabellerrDataset\n", + "from labellerr.core.exceptions import LabellerrError\n", "import os\n", "from tqdm.notebook import tqdm\n" ] @@ -61,7 +62,83 @@ "\n", "api_key = config[\"API_KEY\"]\n", "api_secret = config[\"API_SECRET\"]\n", - "client_id = config[\"CLIENT_ID\"]" + "client_id = config[\"CLIENT_ID\"]\n", + "email = config[\"EMAIL\"]" + ] + }, + { + "cell_type": "markdown", + "id": "d2646549", + "metadata": {}, + "source": [ + "## Kaggle Dataset Download and Project creation" + ] + }, + { + "cell_type": "markdown", + "id": "c2d2a744", + "metadata": {}, + "source": [ + "Before downloading the dataset from Kaggle, you need to:\n", + "\n", + "1. Install kagglehub package using pip\n", + "2. Authenticate with Kaggle\n", + "3. Download the CCTV footage dataset\n", + "\n", + "The kagglehub package provides a simple interface to download datasets directly from Kaggle. Make sure you have a Kaggle account and API credentials set up before proceeding.\n", + "\n", + "Note: If you haven't set up Kaggle authentication before, you'll need to:\n", + "1. Create a Kaggle account at https://www.kaggle.com\n", + "2. Go to \"Account\" settings\n", + "3. Scroll to API section and click \"Create New API Token\"\n", + "4. This will download a kaggle.json file with your credentials" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "be12bf3f", + "metadata": {}, + "outputs": [], + "source": [ + "# !pip install kagglehub ipywidgets" + ] + }, + { + "cell_type": "raw", + "id": "e05889d7", + "metadata": { + "vscode": { + "languageId": "raw" + } + }, + "source": [ + "import kagglehub\n", + "\n", + "kagglehub.login()" + ] + }, + { + "cell_type": "raw", + "id": "c5b93e97", + "metadata": { + "vscode": { + "languageId": "raw" + } + }, + "source": [ + "# Download 1000 videos(~1 min) dataset\n", + "\n", + "# large video dataset(1000 videos)\n", + "# path_to_dataset = kagglehub.dataset_download(\"yashsuman/cctv-footage\")\n", + "\n", + "# medium video dataset(1000 videos)\n", + "# path_to_dataset = kagglehub.dataset_download(\"yashsuman/cctv-footage\")\n", + "\n", + "# small video dataset(5 videos)\n", + "path_to_dataset = kagglehub.dataset_download(\"mistag/short-videos\")\n", + "\n", + "print(\"Path to dataset files:\", path_to_dataset)" ] }, { @@ -71,28 +148,212 @@ "source": [ "## 2. Project Configuration\n", "\n", - "### Dataset and Project IDs\n", - "To work with specific datasets and projects in Labellerr, you need their respective IDs. These IDs are unique identifiers that link your code to the correct resources on the platform.\n", + "### Create Project with kaggle dataset\n", + "Create a project with sample annotation template with kaggle dataset" + ] + }, + { + "cell_type": "markdown", + "id": "c1e2e2f3", + "metadata": {}, + "source": [ + "### project_payload structure (keys and purpose)\n", + "- client_id: str — client identifier.\n", + "- dataset_name: str — human-readable dataset name.\n", + "- dataset_description: str — short description of the dataset.\n", + "- data_type: str — \"video\" (or \"image\") indicating dataset type.\n", + "- created_by: str — email of the creator/owner.\n", + "- project_name: str — name for the new Labellerr project.\n", + "- annotation_guide: list — annotation questions; each question includes:\n", + " - question_number (int), question (str), question_id (str), option_type (str),\n", + " - required (bool), options (list of option objects with option_name, etc.)\n", + "- rotation_config: dict — rotation counts for annotation, review, and client review:\n", + " - annotation_rotation_count, review_rotation_count, client_review_rotation_count\n", + "- autolabel: bool — whether to enable autolabeling.\n", + "- folder_to_upload: str — local folder path containing files to upload to the project.\n", + "\n", + "### Typical usage steps\n", + "1. Ensure .env has API_KEY, API_SECRET, CLIENT_ID, EMAIL and `config` is loaded.\n", + "2. Ensure `path_to_dataset` points to the correct local dataset folder.\n", + "3. Instantiate client if not already done:\n", + " client = LabellerrClient(api_key, api_secret, client_id)\n", + "4. Review or adjust `project_payload` (annotation guide, rotation, folder_to_upload).\n", + "5. Create the project:\n", + " try:\n", + " result = client.initiate_create_project(project_payload)\n", + " project_id = result['project_id']['response']['project_id']\n", + " except LabellerrError as e:\n", + " handle or log the exception\n", + "\n", + "## Notes & best practices\n", + "- Do not commit API credentials to source control.\n", + "- Verify `folder_to_upload` contains the expected video files before initiating the create-project call.\n", + "- Customize `annotation_guide` to match your annotation schema and color/options.\n", + "- Use rotation_config to control annotation/review distribution and workload." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "55b42671", + "metadata": {}, + "outputs": [], + "source": [ + "client = LabellerrClient(api_key, api_secret, client_id)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "7be23d9a", + "metadata": {}, + "outputs": [], + "source": [ + "path_to_dataset = r\"D:\\Professional\\tensormatics_SDKPython\\.cache\\kagglehub\\datasets\\mistag\\short-videos\\versions\\4\"" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "94adb94a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dataset created with ID: 5b0c7653-3adf-4ee8-ad3c-dfd9654b182c\n", + "Total files: 0\n" + ] + } + ], + "source": [ + "from labellerr.core.datasets import create_dataset\n", + "from labellerr.core.schemas import DatasetConfig\n", + "from pathlib import Path\n", + "\n", + "\n", + "if not Path(path_to_dataset).exists():\n", + " raise FileNotFoundError(f\"Path does not exist: {path_to_dataset}\")\n", "\n", - "How to obtain the IDs:\n", - "1. Go to the Labellerr platform\n", - "2. Create or select an existing dataset\n", - "3. Create or select an existing project\n", - "4. Copy the dataset_id and project_id from their respective pages\n", + "dataset = create_dataset(\n", + " client=client,\n", + " dataset_config=DatasetConfig(\n", + " dataset_name=\"SDK-Test\",\n", + " dataset_description=\"a sample dataset of video\",\n", + " data_type=\"video\",\n", + " connector_type=\"local\"\n", + " ),\n", + " folder_to_upload=path_to_dataset,\n", + " path=\"local\"\n", + " \n", + ")\n", "\n", - "Note: The dataset_id is a UUID format string, while the project_id is typically a human-readable string." + "print(f\"Dataset created with ID: {dataset.dataset_id}\")\n", + "print(f\"Total files: {dataset.files_count}\") # only after video processing, right no is shown else 0 is shown always" ] }, { "cell_type": "code", - "execution_count": 3, - "id": "07dcfae9", + "execution_count": null, + "id": "5b7e6f39", + "metadata": {}, + "outputs": [], + "source": [ + "print(f\"Dataset ID: {dataset.dataset_id}\")\n", + "print(f\"Data Type: {dataset.data_type}\")\n", + "print(f\"Files Count: {dataset.files_count}\")\n", + "print(f\"Status Code: {dataset.status_code}\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c9f6eff1", + "metadata": {}, + "outputs": [], + "source": [ + "from labellerr.core.projects import create_annotation_guideline\n", + "import uuid\n", + "\n", + "questions = [\n", + " { \"question_number\": 1,\n", + " \"question\": \"Test_12345\",\n", + " \"option_type\": \"polygon\",\n", + " \"required\": True,\n", + " \"question_id\": str(uuid.uuid4()),\n", + " \"options\": [\n", + " { \"option_name\": \"#fe1236\" }\n", + " ]\n", + " }\n", + "]\n", + "\n", + "template_id = create_annotation_guideline(\n", + " client=client, \n", + " questions=questions, \n", + " template_name='SDK_template', \n", + " data_type='video'\n", + ")\n", + "print(f\"Annotation template created with ID: {template_id}\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6027577d", + "metadata": {}, + "outputs": [], + "source": [ + "project_payload = {\n", + " 'data_type': \"video\",\n", + " 'created_by': email,\n", + " 'project_name': \"SDK workflow\",\n", + " # \"datasets\": [dataset.dataset_id],\n", + " \"datasets\": [\"d49f5cfb-cc72-420d-a3d1-68eaadf69f5a\"],\n", + " 'annotation_template_id': template_id,\n", + " 'rotation_config': {\n", + " 'annotation_rotation_count': 1,\n", + " 'review_rotation_count': 1,\n", + " 'client_review_rotation_count': 1\n", + " },\n", + " 'autolabel': False,\n", + " # 'folder_to_upload': 'path/to/your/dataset'\n", + "}\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2bad0ec0", + "metadata": {}, + "outputs": [], + "source": [ + "from labellerr.core.projects import create_project\n", + "try:\n", + " result = create_project(client, project_payload)\n", + " print(f\"Project created successfully. Project ID: {result.project_id}\")\n", + "except LabellerrError as e:\n", + " print(f\"Project creation failed: {str(e)}\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "69c5e5ab", + "metadata": {}, + "outputs": [], + "source": [ + "result.attached_datasets\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b1ca38e6", "metadata": {}, "outputs": [], "source": [ - "# go to our platform to create dataset and project then get their ids\n", - "dataset_id = \"16257fd6-b91b-4d00-a680-9ece9f3f241c\"\n", - "project_id = \"gabrila_artificial_duck_74237\"" + "result.project_data" ] }, { @@ -113,78 +374,67 @@ }, { "cell_type": "code", - "execution_count": 4, - "id": "9eaec7e1", + "execution_count": null, + "id": "9d91db16", "metadata": {}, "outputs": [], "source": [ - "client = LabellerrClient(api_key, api_secret, client_id) \n", - "dataset = LabellerrDataset(client, dataset_id, project_id)" + "# dataset.dataset_id\n", + "\n", + "# dataset_id = 'd49f5cfb-cc72-420d-a3d1-68eaadf69f5a'\n", + "# project_id = 'aurora_pretty_camel_16090'" ] }, { "cell_type": "code", "execution_count": 5, - "id": "7b6a7052", + "id": "15c901ae", + "metadata": {}, + "outputs": [], + "source": [ + "from labellerr.core.datasets import LabellerrDataset\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "9eaec7e1", + "metadata": {}, + "outputs": [], + "source": [ + "# from labellerr.core.datasets import LabellerrDataset\n", + "files = LabellerrDataset(client, dataset_id)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "cf0aa76f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "\n", - "######################################################################\n", - "# Starting batch video processing for dataset: 16257fd6-b91b-4d00-a680-9ece9f3f241c\n", - "######################################################################\n", - "\n", - "Total file IDs extracted: 1\n", - "\n", - "Creating LabellerrFile instances for 1 files...\n", - "Successfully created 1 LabellerrFile instances\n", - "\n", - "Processing 1 video files...\n", - "\n", - "\n", - "Starting download of 1 files...\n", - "\n", - "============================================================\n", - "Processing file: c44f38f6-0186-436f-8c2d-ffb50a539c76\n", - "============================================================\n", - "\n", - "[1/4] Fetching frame data from API (0 to 1440)...\n", - "Retrieved 1440 frames\n", - "\n", - "[2/4] Setting up output folders...\n", - "\n", - "[3/4] Downloading frames...\n", - "Starting download of 1440 frames...\n", - "Frames downloaded: 1440/1440 (1440 successful, 0 failed)\n", - "\n", - "[4/4] Creating video from frames...\n", - "Running command: ffmpeg -y -start_number 0 -framerate 30 -i ./Labellerr_datastets\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\%d.jpg -c:v libx264 -pix_fmt yuv420p ./Labellerr_datastets\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\c44f38f6-0186-436f-8c2d-ffb50a539c76.mp4\n", - "Video saved as ./Labellerr_datastets\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\c44f38f6-0186-436f-8c2d-ffb50a539c76.mp4\n", - "\n", - "Cleaning up temporary frames...\n", - "Removed temporary frames folder: ./Labellerr_datastets\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\c44f38f6-0186-436f-8c2d-ffb50a539c76\n", - "\n", - "============================================================\n", - "✓ Processing complete!\n", - "Video saved to: ./Labellerr_datastets\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\c44f38f6-0186-436f-8c2d-ffb50a539c76.mp4\n", - "============================================================\n", - "\n", - "Files processed: 1/1 (1 successful, 0 failed)\n", - "######################################################################\n", - "# Batch Processing Complete\n", - "# Total files: 1\n", - "# Successful: 1\n", - "# Failed: 0\n", - "######################################################################\n", - "\n" + "Total file IDs extracted: 3\n" ] } ], "source": [ - "results = dataset.download()" + "labellerrfile_list = files.fetch_files()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "995fc600", + "metadata": {}, + "outputs": [], + "source": [ + "# import logging\n", + "# logging.basicConfig(level=logging.DEBUG)\n", + "\n", + "labellerrfile = files.download(project_id)" ] }, { @@ -231,14 +481,14 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "f5c41073", "metadata": {}, "outputs": [], "source": [ - "from labellerr.services.video_sampling.pyscene_detect import PySceneDetect\n", - "from labellerr.services.video_sampling.ssim import SSIMSceneDetect\n", - "from labellerr.services.video_sampling.ffmpeg import FFMPEGSceneDetect" + "from labellerr.services.video_sampling import PySceneDetect\n", + "from labellerr.services.video_sampling import SSIMSceneDetect\n", + "from labellerr.services.video_sampling import FFMPEGSceneDetect" ] }, { @@ -260,17 +510,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 25, "id": "49a6f89d", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Path exists ✅\n" + ] + } + ], "source": [ - "dataset_dir = f\".\\Labellerr_datasets\\{dataset_id}\"" + "from pathlib import Path\n", + "\n", + "dataset_dir = Path(f\".\\\\Labellerr_datasets\\\\{dataset_id}\")\n", + "\n", + "if dataset_dir.exists():\n", + " print(\"Path exists ✅\")\n", + "else:\n", + " print(\"Path does not exist ❌\")\n" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "dd96be8c", "metadata": {}, "outputs": [], @@ -289,19 +554,10 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "id": "a3052f25", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Keyframes extracted to FFMPEG_detects\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\frames\n", - "JSON mapping saved to: FFMPEG_detects\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\c44f38f6-0186-436f-8c2d-ffb50a539c76_mapping.json\n" - ] - } - ], + "outputs": [], "source": [ "for filename in os.listdir(dataset_dir):\n", " file_path = os.path.join(dataset_dir, filename)\n", @@ -350,18 +606,10 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "id": "1b364362", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Found 52 image files\n" - ] - } - ], + "outputs": [], "source": [ "import os\n", "\n", @@ -384,79 +632,17 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "f39153ab", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\0.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1008.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1016.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1028.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1060.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1082.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1106.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1119.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1137.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1157.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1175.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1189.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\119.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1201.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1218.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1233.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1246.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1257.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1278.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1312.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\1319.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\141.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\233.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\263.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\37.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\381.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\408.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\437.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\457.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\484.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\508.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\552.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\575.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\590.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\619.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\63.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\647.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\683.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\706.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\721.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\758.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\776.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\805.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\823.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\83.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\836.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\858.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\876.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\893.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\915.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\949.jpg',\n", - " 'FFMPEG_detects\\\\16257fd6-b91b-4d00-a680-9ece9f3f241c\\\\c44f38f6-0186-436f-8c2d-ffb50a539c76\\\\frames\\\\99.jpg']" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "images_files" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "id": "40c70986", "metadata": {}, "outputs": [], @@ -489,36 +675,17 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "a1d96b25", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dataset created successfully!\n", - "Dataset ID: 6a680901-fe81-49f0-9120-bb754d63a341\n" - ] - }, - { - "data": { - "text/plain": [ - "'6a680901-fe81-49f0-9120-bb754d63a341'" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "upload_images_from_files(images_files, client, client_id)" ] }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "id": "958fc75e", "metadata": {}, "outputs": [], @@ -601,19 +768,10 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": null, "id": "9f682f4f", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Project created successfully!\n", - "Project ID: sherri_puny_rattlesnake_84247\n" - ] - } - ], + "outputs": [], "source": [ "if response['response']['project_id']:\n", " print(f\"Project created successfully!\")\n", @@ -697,7 +855,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "df6b3ac7", "metadata": {}, "outputs": [], @@ -708,7 +866,7 @@ ], "metadata": { "kernelspec": { - "display_name": "SDk", + "display_name": ".venv", "language": "python", "name": "python3" }, @@ -722,7 +880,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.18" + "version": "3.12.0" } }, "nbformat": 4,