-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91852df
commit fb62188
Showing
1 changed file
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"nbformat": 4, | ||
"nbformat_minor": 0, | ||
"metadata": { | ||
"colab": { | ||
"provenance": [], | ||
"authorship_tag": "ABX9TyP0+g7687kcRdET2h+dYEFF" | ||
}, | ||
"kernelspec": { | ||
"name": "python3", | ||
"display_name": "Python 3" | ||
}, | ||
"language_info": { | ||
"name": "python" | ||
} | ||
}, | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": { | ||
"colab": { | ||
"base_uri": "https://localhost:8080/" | ||
}, | ||
"id": "GqcZz-KtjaGX", | ||
"outputId": "7f40f20d-81a6-488d-ea13-356429aacba5" | ||
}, | ||
"outputs": [ | ||
{ | ||
"output_type": "stream", | ||
"name": "stdout", | ||
"text": [ | ||
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", | ||
"Collecting tell_a_vision\n", | ||
" Downloading tell_a_vision-0.1.5-py3-none-any.whl (4.5 kB)\n", | ||
"Requirement already satisfied: numpy>=1.21.0 in /usr/local/lib/python3.7/dist-packages (from tell_a_vision) (1.21.6)\n", | ||
"Collecting gTTs>=2.2.4\n", | ||
" Downloading gTTS-2.2.4-py3-none-any.whl (26 kB)\n", | ||
"Requirement already satisfied: click in /usr/local/lib/python3.7/dist-packages (from gTTs>=2.2.4->tell_a_vision) (7.1.2)\n", | ||
"Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from gTTs>=2.2.4->tell_a_vision) (1.15.0)\n", | ||
"Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from gTTs>=2.2.4->tell_a_vision) (2.23.0)\n", | ||
"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->gTTs>=2.2.4->tell_a_vision) (3.0.4)\n", | ||
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->gTTs>=2.2.4->tell_a_vision) (2.10)\n", | ||
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->gTTs>=2.2.4->tell_a_vision) (1.24.3)\n", | ||
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->gTTs>=2.2.4->tell_a_vision) (2022.6.15)\n", | ||
"Installing collected packages: gTTs, tell-a-vision\n", | ||
"Successfully installed gTTs-2.2.4 tell-a-vision-0.1.5\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"!pip install --upgrade tell_a_vision" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"!gdown 13tkKNm-HGJjlXpRpLatBB1NtQ7P2oIZU" | ||
], | ||
"metadata": { | ||
"colab": { | ||
"base_uri": "https://localhost:8080/" | ||
}, | ||
"id": "hoYlcWeblQ2q", | ||
"outputId": "c8c4ddfb-abf1-4141-8d63-d3a550fd1821" | ||
}, | ||
"execution_count": 14, | ||
"outputs": [ | ||
{ | ||
"output_type": "stream", | ||
"name": "stdout", | ||
"text": [ | ||
"--2022-09-09 21:46:02-- https://drive.google.com/uc?id=13tkKNm-HGJjlXpRpLatBB1NtQ7P2oIZU\n", | ||
"Resolving drive.google.com (drive.google.com)... 74.125.195.139, 74.125.195.102, 74.125.195.113, ...\n", | ||
"Connecting to drive.google.com (drive.google.com)|74.125.195.139|:443... connected.\n", | ||
"HTTP request sent, awaiting response... 200 OK\n", | ||
"Length: unspecified [text/html]\n", | ||
"Saving to: ‘uc?id=13tkKNm-HGJjlXpRpLatBB1NtQ7P2oIZU’\n", | ||
"\n", | ||
"\r uc?id=13t [<=> ] 0 --.-KB/s \ruc?id=13tkKNm-HGJjl [ <=> ] 2.20K --.-KB/s in 0s \n", | ||
"\n", | ||
"2022-09-09 21:46:02 (51.1 MB/s) - ‘uc?id=13tkKNm-HGJjlXpRpLatBB1NtQ7P2oIZU’ saved [2257]\n", | ||
"\n" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"import xml.etree.ElementTree as ET\n", | ||
"import os" | ||
], | ||
"metadata": { | ||
"id": "3lv6ypilGfnS" | ||
}, | ||
"execution_count": 7, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"def get_annotation_dict(annotations_path):\n", | ||
" annotations = {}\n", | ||
" for file in os.listdir(annotations_path):\n", | ||
" if not file.endswith('.xml'):\n", | ||
" continue\n", | ||
" tree = ET.parse(f'{annotations_path}{file}')\n", | ||
" root = tree.getroot()\n", | ||
" filename = root.find('filename')\n", | ||
" objects = []\n", | ||
" for obj in root.findall('object'):\n", | ||
" class_label = obj.find('name')\n", | ||
" " | ||
], | ||
"metadata": { | ||
"id": "owSP8df1D4cg" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
} | ||
] | ||
} |