Download the PHP package ankitpokhrel/alt without Composer
On this page you can find all versions of the php package ankitpokhrel/alt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ankitpokhrel/alt
More information about ankitpokhrel/alt
Files in ankitpokhrel/alt
Package alt
Short Description Automatic alternative (alt) text for images using object detection with pre-trained model.
License MIT
Informations about the package alt
This project is now available at captionai.co
CaptionAI effortlessly generates automatic image captions (alternate text), description, tags, and helps you categorize images using the power of AI.
alt
This project is no longer maintained.
Automatic alternative (alt) text for images using object detection with pre-trained model.
Overview
A very simple PHP library to generate alternative (alt) text for images using pre-trained tensorflow model to detect objects in an image. These texts can provide context about image to visitors who are unable to see images in their browser for whatever reasons. Alt texts can also be picked up by screen readers to convert it to speech, thus, providing additional context to visually impaired people and enhancing our user experience.
This nifty little tool is inspired by facebook alt text generation process.
Example
Image may contain: cup, potted, laptop |
Image may contain: 6 person, cup, laptop |
Image may contain: 5 person, car, motorcycle |
Image may contain: 1 person, car, bus, truck, traffic light |
Image may contain: chair, couch |
Image may contain: pizza, dining table |
Image may contain: dog |
Image may contain: bird |
Installation
Requires: PHP 7.1.3+, OpenCV, PHP OpenCV
Model used: SSDLite COCO v2
Pull the package via composer.
Usage
Threshold
The classification threshold is set to 30
by default. You can adjust it as your need.
Prefix
By default the alt is prefixed with Image may contain:
. You can change this as below:
Countable
If you want to display the count of an object, you can do so by setting countable
array. person
is countable by default.
Default text
Default text is used if the model is not able to predict any objects within a given threshold. Default default text is No photo description available.
.