PHPackages                             ghostjat/darknet - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ghostjat/darknet

ActiveLibrary

ghostjat/darknet
================

PHP bindings to the Darknet.

25284PHP

Since May 12Pushed 5y ago2 watchersCompare

[ Source](https://github.com/ghostjat/php-darknet)[ Packagist](https://packagist.org/packages/ghostjat/darknet)[ RSS](/packages/ghostjat-darknet/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-darknet
===========

[](#php-darknet)

\[[![Minimum PHP version: 7.4.0](https://camo.githubusercontent.com/89e54687773afb25f5943cfbd66376d73e2ce50874c54429a78aac45cb6bcf84/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342e302532422d626c75652e737667)](https://camo.githubusercontent.com/89e54687773afb25f5943cfbd66376d73e2ce50874c54429a78aac45cb6bcf84/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342e302532422d626c75652e737667)\] [![Packagist](https://camo.githubusercontent.com/ec01284350f0d9eb5c4b3010255c0ec899b0b1b70bfa8293328fe5b851ab5c5c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67686f73746a61742f7068702d6461726b6e65742e737667)](https://packagist.org/packages/ghostjat/darknet)[![Build Status](https://camo.githubusercontent.com/624ce939bbb05da38779c19fdad65f77f9b3b1afc06ff22b18987bdd4bfe0501/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67686f73746a61742f7068702d6461726b6e65742f6261646765732f6275696c642e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/ghostjat/php-darknet/build-status/main)[![Code Intelligence Status](https://camo.githubusercontent.com/40e5608a97246589ca0b045637ac4b0d1de758cd3dbc7ceef668702b77096074/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67686f73746a61742f7068702d6461726b6e65742f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d61696e)](https://scrutinizer-ci.com/code-intelligence)

[![Darknet Logo](darknet.png)](darknet.png)

php-ffi experiment
==================

[](#php-ffi-experiment)

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

Install
-------

[](#install)

composer require ghostjat/darknet

Description
-----------

[](#description)

[lib-darknet](https://github.com/pjreddie/darknet)

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
===============

[](#yolo-v2-v3-v4)

If running on cpu you may use FASTEST cfg &amp; 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

YOLOTime (ms)CPUMem(mb)(max)Tiny-v20.85933095 (max)78143.590.62237596 (min)Tiny-v30.93895602 (max)90125.90.60306811 (min)Main-v3**15.4672219 (max)**98964.514.0677847 (min)Tiny-v40.85933095 (max)82151.90.62237596 (min)FASTEST0.20039399 (max)2097.47**0.11836814 (min)**FASTEST-xl0.80017591 (max)69131.850.22637511 (min)Synopsis
--------

[](#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](https://github.com/ghostjat/php-darknet/raw/main/php-darknet.gif)](https://github.com/ghostjat/php-darknet/blob/main/php-darknet.gif)[![gp](https://camo.githubusercontent.com/1a4a56d2ced823ac8f4d6cd4d017992ea38c1dae67e8505f97f3c95766c2d275/68747470733a2f2f7261772e6769746875622e636f6d2f67686f73746a61742f7068702d6461726b6e65742f6d61737465722f74656d702f6f75742f67702e6a7067)](https://camo.githubusercontent.com/1a4a56d2ced823ac8f4d6cd4d017992ea38c1dae67e8505f97f3c95766c2d275/68747470733a2f2f7261772e6769746875622e636f6d2f67686f73746a61742f7068702d6461726b6e65742f6d61737465722f74656d702f6f75742f67702e6a7067)[![dog](https://camo.githubusercontent.com/51d6ec1f5b051c641bf0c2140585ba3db541bf0060b67e5022c658415e80eed6/68747470733a2f2f7261772e6769746875622e636f6d2f67686f73746a61742f7068702d6461726b6e65742f6d61737465722f74656d702f6f75742f646f672e6a7067)](https://camo.githubusercontent.com/51d6ec1f5b051c641bf0c2140585ba3db541bf0060b67e5022c658415e80eed6/68747470733a2f2f7261772e6769746875622e636f6d2f67686f73746a61742f7068702d6461726b6e65742f6d61737465722f74656d702f6f75742f646f672e6a7067)[![egale](https://camo.githubusercontent.com/7c7cbb69e258c73df7629db3d958532d32751be09fb7c1d6f72f57ebe737c513/68747470733a2f2f7261772e6769746875622e636f6d2f67686f73746a61742f7068702d6461726b6e65742f6d61737465722f74656d702f6f75742f6561676c652e6a7067)](https://camo.githubusercontent.com/7c7cbb69e258c73df7629db3d958532d32751be09fb7c1d6f72f57ebe737c513/68747470733a2f2f7261772e6769746875622e636f6d2f67686f73746a61742f7068702d6461726b6e65742f6d61737465722f74656d702f6f75742f6561676c652e6a7067)[![giraffe](https://camo.githubusercontent.com/eb73a572ea7f00f2e4544f6f2f9f36fa6145942bdf67f58da5c7377913b05e74/68747470733a2f2f7261772e6769746875622e636f6d2f67686f73746a61742f7068702d6461726b6e65742f6d61737465722f74656d702f6f75742f676972616666652e6a7067)](https://camo.githubusercontent.com/eb73a572ea7f00f2e4544f6f2f9f36fa6145942bdf67f58da5c7377913b05e74/68747470733a2f2f7261772e6769746875622e636f6d2f67686f73746a61742f7068702d6461726b6e65742f6d61737465722f74656d702f6f75742f676972616666652e6a7067)[![person](https://camo.githubusercontent.com/11a0d45b9f37c46558ea71ceccb0761f96d9f9a34f32294eeb97d93299afe287/68747470733a2f2f7261772e6769746875622e636f6d2f67686f73746a61742f7068702d6461726b6e65742f6d61737465722f74656d702f6f75742f706572736f6e2e6a7067)](https://camo.githubusercontent.com/11a0d45b9f37c46558ea71ceccb0761f96d9f9a34f32294eeb97d93299afe287/68747470733a2f2f7261772e6769746875622e636f6d2f67686f73746a61742f7068702d6461726b6e65742f6d61737465722f74656d702f6f75742f706572736f6e2e6a7067)

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

[](#author)

Shubham Chaudhary

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/64d55c44db241b5edf53d7f95b9209822731ed613173055ad2535f03137f119c?d=identicon)[ghostjat](/maintainers/ghostjat)

---

Top Contributors

[![ghostjat](https://avatars.githubusercontent.com/u/18235933?v=4)](https://github.com/ghostjat "ghostjat (27 commits)")

---

Tags

cnndarknetdetectionlib-darknetobject-detectionphpphp-darknetphp-ffiphp-libraryphp7php8yoloyolo-tinyyolov2yolov3yolov4

### Embed Badge

![Health badge](/badges/ghostjat-darknet/health.svg)

```
[![Health](https://phpackages.com/badges/ghostjat-darknet/health.svg)](https://phpackages.com/packages/ghostjat-darknet)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
