Skip to content

Commit

Permalink
yolo object detection
Browse files Browse the repository at this point in the history
  • Loading branch information
sowmyasris committed Aug 27, 2024
1 parent 680d879 commit 281f1ed
Show file tree
Hide file tree
Showing 269 changed files with 61,434 additions and 15,411 deletions.
1 change: 1 addition & 0 deletions examples/Yolo-object-detection/-metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"num_examples": 1841, "batch_size": 64, "epochs": 1, "lr": 0.00261}
147 changes: 147 additions & 0 deletions examples/Yolo-object-detection/Untitled.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 24,
"id": "d545b1ea-9c0f-486f-aeac-9c566d3ca6bb",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 0 2 5 38400 0]\n",
"[]\n"
]
}
],
"source": [
"import numpy as np\n",
"\n",
"darkfile1 = \"/home/sowmya/yolo_computer/darknet/yolov4_tiny/yolov4-tiny_final.weights\" # Pretrained weights file\n",
"fp = open(darkfile1, \"rb\")\n",
"ww = np.fromfile(fp,dtype=np.int32)\n",
"print(ww[:5])\n",
"header=np.fromfile(fp,dtype=np.int32,count=5)\n",
"print(header)\n",
"w1 = np.fromfile(fp, dtype=np.float32)\n",
"fp.close()"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "bbd79c02-ad6b-4dcd-9bf6-ff8af25f3720",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[0 0 0 0 0]\n"
]
}
],
"source": [
"darkfile2 = \"/home/sowmya/yolo_computer/darknet/yolov4_tiny/yolov4-tiny_final2.weights\" # Pretrained weights file\n",
"fp = open(darkfile2, \"rb\")\n",
"header=np.fromfile(fp,dtype=np.int32,count=5)\n",
"print(header)\n",
"w2 = np.fromfile(fp, dtype=np.float32)\n",
"fp.close()"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "18c12401-a625-433d-a8a1-fed5da898e47",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.0"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.linalg.norm(w1-w2)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "82e07c0a-651c-4195-8f62-9e2b2bc0ce85",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([-0.00705129, 0.01110012, -0.01678175, -0.00561042], dtype=float32)"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"w2[:4]"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "16badc7a-7ceb-4972-b04b-5c82ab5a295c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([-0.00705129, 0.01110012, -0.01678175, -0.00561042], dtype=float32)"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"w1[:4]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fecca75c-07ed-4bdc-903d-f61e66daddee",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "mattias kernel",
"language": "python",
"name": "mattiaskernel"
},
"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.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
268 changes: 268 additions & 0 deletions examples/Yolo-object-detection/client/bad.list

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions examples/Yolo-object-detection/client/darknet/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2.0
jobs:
build:
docker:
- image: datamachines/cudnn_tensorflow_opencv:11.2.0_2.4.1_4.5.1-20210211
# - image: alexeyab84/dockerfiles:latest
# - image: alantrrs/cuda-opencv:latest
# - image: nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
working_directory: ~/work
steps:
- checkout
- run: nvcc --version
- run: gcc --version
- run: export PATH=$PATH:/usr/local/include/opencv4/
- run: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/:/usr/lib/:/usr/lib64/
- run: make LIBSO=1 GPU=0 CUDNN=0 OPENCV=0 -j 8
- run: make clean
- run: make LIBSO=1 GPU=0 CUDNN=0 OPENCV=0 DEBUG=1 -j 8
- run: make clean
- run: make LIBSO=1 GPU=0 CUDNN=0 OPENCV=0 AVX=1 -j 8
- run: make clean
- run: make LIBSO=1 GPU=0 CUDNN=0 OPENCV=1 -j 8
- run: make clean
- run: make LIBSO=1 GPU=1 CUDNN=0 OPENCV=1 -j 8
- run: make clean
- run: make LIBSO=1 GPU=1 CUDNN=1 OPENCV=1 -j 8
- run: make clean
- run: make LIBSO=1 GPU=1 CUDNN=1 OPENCV=1 CUDNN_HALF=1 -j 8
- run: make clean
- run: make LIBSO=1 GPU=1 CUDNN=1 OPENCV=1 CUDNN_HALF=1 USE_CPP=1 -j 8
12 changes: 12 additions & 0 deletions examples/Yolo-object-detection/client/darknet/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://paypal.me/alexeyab84', 'https://blockchain.coinmarketcap.com/address/bitcoin/36La9T7DoLVMrUQzm6rBDGsxutyvDzbHnp', 'https://etherscan.io/address/0x193d56BE3C65e3Fb8f48c291B17C0702e211A588#', 'https://explorer.zcha.in/accounts/t1PzwJ28Prb7Nk8fgfT3RXCr6Xtw54tgjoy'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Any other question or issue
about: Any other question or issue
title: ''
labels: ''
assignees: ''

---

If something doesn’t work for you, then show 2 screenshots:
1. screenshots of your issue
2. screenshots with such information
```
./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/dog.jpg
CUDA-version: 10000 (10000), cuDNN: 7.4.2, CUDNN_HALF=1, GPU count: 1
CUDNN_HALF=1
OpenCV version: 4.2.0
0 : compute_capability = 750, cudnn_half = 1, GPU: GeForce RTX 2070
net.optimized_memory = 0
mini_batch = 1, batch = 8, time_steps = 1, train = 0
layer filters size/strd(dil) input output
0 conv 32 3 x 3/ 1 608 x 608 x 3 -> 608 x 608 x 32 0.639 BF
```

If you do not get an answer for a long time, try to find the answer among Issues with a Solved label: https://github.com/AlexeyAB/darknet/issues?q=is%3Aopen+is%3Aissue+label%3ASolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

If you want to report a bug - provide:
* description of a bug
* what command do you use?
* do you use Win/Linux/Mac?
* attach screenshot of a bug with previous messages in terminal
* in what cases a bug occurs, and in which not?
* if possible, specify date/commit of Darknet that works without this bug
* show such screenshot with info
```
./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/dog.jpg
CUDA-version: 10000 (10000), cuDNN: 7.4.2, CUDNN_HALF=1, GPU count: 1
CUDNN_HALF=1
OpenCV version: 4.2.0
0 : compute_capability = 750, cudnn_half = 1, GPU: GeForce RTX 2070
net.optimized_memory = 0
mini_batch = 1, batch = 8, time_steps = 1, train = 0
layer filters size/strd(dil) input output
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: Feature-request
assignees: ''

---

For Feature-request:
* describe your feature as detailed as possible
* provide link to the paper and/or source code if it exist
* attach chart/table with comparison that shows improvement
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Training issue - no-detections / Nan avg-loss / low accuracy
about: Training issue - no-detections / Nan avg-loss / low accuracy
title: ''
labels: Training issue
assignees: ''

---

If you have an issue with training - no-detections / Nan avg-loss / low accuracy:
* read FAQ: https://github.com/AlexeyAB/darknet/wiki/FAQ---frequently-asked-questions
* what command do you use?
* what dataset do you use?
* what Loss and mAP did you get?
* show chart.png with Loss and mAP
* check your dataset - run training with flag `-show_imgs` i.e. `./darknet detector train ... -show_imgs` and look at the `aug_...jpg` images, do you see correct truth bounded boxes?
* rename your cfg-file to txt-file and drag-n-drop (attach) to your message here
* show content of generated files `bad.list` and `bad_label.list` if they exist
* Read `How to train (to detect your custom objects)` and `How to improve object detection` in the Readme: https://github.com/AlexeyAB/darknet/blob/master/README.md
* show such screenshot with info
```
./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/dog.jpg
CUDA-version: 10000 (10000), cuDNN: 7.4.2, CUDNN_HALF=1, GPU count: 1
CUDNN_HALF=1
OpenCV version: 4.2.0
0 : compute_capability = 750, cudnn_half = 1, GPU: GeForce RTX 2070
net.optimized_memory = 0
mini_batch = 1, batch = 8, time_steps = 1, train = 0
layer filters size/strd(dil) input output
```
Loading

0 comments on commit 281f1ed

Please sign in to comment.