Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-074
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-074
2022-074
Commits
8d2e69e5
Commit
8d2e69e5
authored
Mar 02, 2022
by
IT19110530-Pramodini A.A.D.A
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Custom Object detection impl
parent
2294dfee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
330 additions
and
0 deletions
+330
-0
Custom-Obj-Detection/Object_custom_detection.ipynb
Custom-Obj-Detection/Object_custom_detection.ipynb
+330
-0
No files found.
Custom-Obj-Detection/Object_custom_detection.ipynb
0 → 100644
View file @
8d2e69e5
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Object_custom_detection.ipynb",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Se6UIrjf53Bj",
"outputId": "89eb5ab2-4df1-4ff4-daa9-2e31810152e8"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Mounted at /content/drive\n"
]
}
],
"source": [
"from google.colab import drive\n",
"drive.mount('/content/drive')"
]
},
{
"cell_type": "code",
"source": [
"!ls '/content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training'"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "KsDPBQ0X6F_n",
"outputId": "8db6c9dd-32aa-43cc-988c-c1f5de18d820"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"backup\t\t Custom-Obj-Detection.zip\tdarknet\n",
"Custom-Obj-Detection custom_weight\t\tdata\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"#!unzip '/content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection' -d '/content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training'"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "hEC8x5sJ7Syg",
"outputId": "2dabe77a-b7f4-4729-9a8e-98e0a5582c89"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Archive: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection.zip\n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/ball1.jpg \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/ball1.txt \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/classes.txt \n",
" creating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/data/\n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/data/predefined_classes.txt \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/labelImg.exe \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/rattle1.jpg \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/rattle1.txt \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/rattle2.webp \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/rattle3.jpg \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/rattle3.txt \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/rattle4.jpg \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/rattle4.txt \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/toys.gif \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/toys.txt \n",
" inflating: /content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/Custom-Obj-Detection/traffic.gif \n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!git clone 'https://github.com/pjreddie/darknet.git' '/content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/darknet'"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Zzw5sAjT76Ah",
"outputId": "1e849eec-a4fb-4125-8457-4c617bfbee46"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"fatal: destination path '/content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/darknet' already exists and is not an empty directory.\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"%cd '/content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/darknet'"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "We118bis9Siq",
"outputId": "150e0a2d-e547-4b12-a2b3-2058d80ca7d9"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/darknet\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!ls"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "3z7kIkF89aLR",
"outputId": "9ae60110-a91e-4087-990a-8809439e7c7a"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"backup\t examples\tLICENSE LICENSE.meta obj scripts\n",
"cfg\t include\tLICENSE.fuck LICENSE.mit python src\n",
"darknet libdarknet.a\tLICENSE.gen LICENSE.v1 README.md\n",
"data\t libdarknet.so\tLICENSE.gpl Makefile\t results\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!make"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "xy-2o-hs9tEh",
"outputId": "f28bd0dc-1f9f-4696-b669-2d1a771163d6"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options \"-Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN\" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o\n",
"nvcc fatal : Unsupported gpu architecture 'compute_30'\n",
"Makefile:92: recipe for target 'obj/convolutional_kernels.o' failed\n",
"make: *** [obj/convolutional_kernels.o] Error 1\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"#Exitting from darknet folder to root folder\n",
"%cd '/content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training'"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "64umwmgtFtQw",
"outputId": "a53fe60c-6916-4171-a7bb-bb42a160e791"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"Generating Labelled_data.data, train.txt, and test.txt files into the drive"
],
"metadata": {
"id": "Fco55JKMG-vA"
}
},
{
"cell_type": "code",
"source": [
"!python data/creating-files-data-and-name.py"
],
"metadata": {
"id": "IQZXsjaAGL1W"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"! python data/creating-train-and-test-txt-files.py"
],
"metadata": {
"id": "R6O_acp5GpHx"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"%cd '/content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/darknet'"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ZXntkLmNMdYm",
"outputId": "fadd9f00-16ce-4ff0-cb0b-122179bbc288"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/content/drive/MyDrive/Research-Project/Yolo_Custom_Model_Training/darknet\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!darknet/darknet detector train data/labelled_data.data darknet/cfg/yolov3_custom.cfg data/darknet53.conv.74 -dont_show -map"
],
"metadata": {
"id": "1WJokn7fHVOQ",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "e181d309-2b25-4e69-a913-3dd46b490af9"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/bin/bash: darknet/darknet: Not a directory\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!darknet/darknet"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "d-NkCEIMIkL4",
"outputId": "80a032f6-cba7-4efd-de8d-dee7d4f3b484"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/bin/bash: darknet/darknet: No such file or directory\n"
]
}
]
}
]
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment