1. Go to this page and download the library: Download b7s/fluentvision library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
b7s / fluentvision example snippets
use B7s\FluentVision\FluentVision;
use B7s\FluentVision\Enums\Provider;
use B7s\FluentVision\Enums\YoloModel;
$result = FluentVision::make()
->useUltralytics()
->model(YoloModel::YOLO26s)
->useCpu()
->confidence(0.5)
->media('photo.jpg')
->detect();
echo $result->getDetectionCount() . " objects found\n";
foreach ($result->detections as $detection) {
echo sprintf("- %s (%.1f%%)\n", $detection->class, $detection->confidence * 100);
}
use B7s\FluentVision\Enums\YoloModel;
$result = FluentVision::make()
->useUltralytics()
->model(YoloModel::YOLOE26s)
->useCpu()
->confidence(0.25) // default: 0.4
->prompts(['person', 'yellow hard hat'])
->media('factory.jpg')
->detect();
use B7s\FluentVision\FluentVision;
use B7s\FluentVision\Enums\Device;
use B7s\FluentVision\Enums\Provider;
use B7s\FluentVision\Enums\YoloModel;
use B7s\FluentVision\Enums\NanodetModel;
use B7s\FluentVision\Enums\YoloTask;
FluentVision::make()
->provider(Provider::Ultralytics) // or ->useUltralytics() / ->useNanodet()
->model(YoloModel::YOLO26s) // or ->model('yolo26s.pt') or ->model('/path/to/custom.pt')
->media('/path/to/image.jpg') // media type auto-detected from extension
// ->media('/path/to/clip.mp4') // video — auto-detected from extension
->useCpu() // or ->useGpu()
->confidence(0.5) // confidence threshold
->iou(0.45) // IoU threshold (NMS)
->imgsz(640) // inference image size
->maxDet(100) // max detections per image
->classes(['person', 'car']) // filter to specific classes
->prompts(['person wearing red', 'hard hat']) // YOLOE text prompts
->augment() // test-time augmentation
->half() // FP16 inference (GPU