https://github.com/ghostjat/darknet
php ffi darknet
https://github.com/ghostjat/darknet
cnn darknet detection lib-darknet object-detection php php-darknet php-ffi php-library php7 php8 yolo yolo-tiny yolov2 yolov3 yolov4
Last synced: 18 days ago
JSON representation
php ffi darknet
- Host: GitHub
- URL: https://github.com/ghostjat/darknet
- Owner: ghostjat
- License: apache-2.0
- Created: 2021-02-11T14:41:58.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-12T14:14:29.000Z (about 4 years ago)
- Last Synced: 2025-04-08T18:12:18.117Z (about 1 month ago)
- Topics: cnn, darknet, detection, lib-darknet, object-detection, php, php-darknet, php-ffi, php-library, php7, php8, yolo, yolo-tiny, yolov2, yolov3, yolov4
- Language: PHP
- Homepage:
- Size: 21.1 MB
- Stars: 25
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-darknet
[]
[](https://packagist.org/packages/ghostjat/darknet)
[](https://scrutinizer-ci.com/g/ghostjat/php-darknet/build-status/main)
[](https://scrutinizer-ci.com/code-intelligence)
php-ffi experiment
=========
php interface to the lib-darknet for object detection.
Php7.4+ is requiredInstall
---------
composer require ghostjat/darknetDescription
-----------
[lib-darknet](https://github.com/pjreddie/darknet)# Darknet #
Darknet is an open source neural network framework written in C and CUDA. It is fast, easy to install, and supports CPU and GPU computation.* It offers a simple API.
* High performance, due to the fact that it uses native interface elements.
* Fast learning by the user, due to the simplicity of its API.
# yolo v2, v3, v4 #If running on cpu you may use FASTEST cfg & weight for real time object detection on MS COCO dataset.
```phprequire '../vendor/autoload.php';
use darknet\core;
$dn = new core(core::YOLOFASTEST);
```
System-Conf:-
CPU:- Intel(R) Core(TM) i3-2370M CPU @ 2.40GHz 64bit
MEM:- 8GB
Dataset:- MS-COCO Classes:- 80
| YOLO | Time (ms) | CPU | Mem(mb)(max) |
|-----------|-----------------|-----------|---------------|
| Tiny-v2 | 0.85933095 (max)| 78 | 143.59 |
| | 0.62237596 (min)| | |
| Tiny-v3 | 0.93895602 (max)| 90 | 125.9 |
| | 0.60306811 (min)| | |
| Main-v3 | **15.4672219 (max)**| 98 | 964.5 |
| | 14.0677847 (min)| | |
| Tiny-v4 | 0.85933095 (max)| 82 | 151.9 |
| | 0.62237596 (min)| | |
| FASTEST | 0.20039399 (max)| 20 | 97.47 |
| | **0.11836814 (min)**| | |
| FASTEST-xl| 0.80017591 (max)| 69 | 131.85 |
| | 0.22637511 (min)| | |Synopsis
--------
WARNING:
This module is in its early stages and should be considered a Work in Progress.
The interface is not final and may change in the future.Sample:
![]()
![]()
![]()
![]()
![]()
![]()
Sample code:
```php
require '../vendor/autoload.php';
use darknet\core;
$lib = '/home/ghost/bin/c-lib/darknet/data/';
$img = ['eagle.jpg','giraffe.jpg','horses.jpg','person.jpg','kite.jpg'];
$dn = new core();
foreach ($img as $value) {
$dn->detect($lib.$value);
}
```
Author
------
Shubham Chaudhary