ghostjat/darknet

PHP bindings to the Darknet.

dev-main 2021-05-12 14:14 UTC

This package is auto-updated.

Last update: 2024-11-12 21:50:54 UTC


README

[Minimum PHP version: 7.4.0] Packagist Build Status Code Intelligence Status

Darknet Logo

php-ffi experiment

php interface to the lib-darknet for object detection. Php7.4+ is required

Install

composer require ghostjat/darknet

Description

lib-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.

require '../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

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:

demo gp dog egale giraffe person

Sample code:

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 ghost.jat@gmail.com