начал 9 лабу

This commit is contained in:
Timourka 2025-03-10 01:07:57 +04:00
parent 1d788ec689
commit 479d34da7f
2 changed files with 127 additions and 1 deletions

4
.gitignore vendored
View File

@ -26,4 +26,6 @@ ipython_config.py
# Built Visual Studio Code Extensions # Built Visual Studio Code Extensions
*.vsix *.vsix
laba laba
data

124
lab_9/laba9.ipynb Normal file
View File

@ -0,0 +1,124 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"d:\\МИИ\\AIM-PIbd-31-Kouvshinoff-T-A\\laba\\Lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading from https://www.kaggle.com/api/v1/datasets/download/stealthknight/bird-vs-drone?dataset_version_number=1...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 1.05G/1.05G [06:47<00:00, 2.77MB/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Extracting files...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Path to dataset files: C:\\Users\\bingo\\.cache\\kagglehub\\datasets\\stealthknight\\bird-vs-drone\\versions\\1\n"
]
}
],
"source": [
"import kagglehub\n",
"\n",
"# Download latest version\n",
"path = kagglehub.dataset_download(\"stealthknight/bird-vs-drone\")\n",
"\n",
"print(\"Path to dataset files:\", path)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Dataset:\n",
"\tREADME.dataset.txt:\n",
"\tREADME.md:\n",
"\tREADME.roboflow.txt:\n",
"\ttest:\n",
"\t\timages\n",
"\t\tlabels\n",
"\ttrain:\n",
"\t\timages\n",
"\t\tlabels\n",
"\tvalid:\n",
"\t\timages\n",
"\t\tlabels\n"
]
}
],
"source": [
"import os\n",
"\n",
"# Выводим содержимое\n",
"for item in os.listdir(path):\n",
" print(item+\":\")\n",
" if os.path.isdir(path+\"/\"+item):\n",
" # Выводим содержимое\n",
" for iitem in os.listdir(path+\"/\"+item):\n",
" print(\"\\t\"+iitem+\":\")\n",
" if os.path.isdir(path+\"/\"+item+\"/\"+iitem):\n",
" # Выводим содержимое\n",
" for iiitem in os.listdir(path+\"/\"+item+\"/\"+iitem):\n",
" print(\"\\t\"+\"\\t\"+iiitem)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "laba",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}