https://github.com/catalystcode/customvision-find-video-tags
Find highest probability video tags with Microsoft custom vision ai in a video
https://github.com/catalystcode/customvision-find-video-tags
Last synced: 10 months ago
JSON representation
Find highest probability video tags with Microsoft custom vision ai in a video
- Host: GitHub
- URL: https://github.com/catalystcode/customvision-find-video-tags
- Owner: CatalystCode
- License: mit
- Created: 2017-09-13T12:08:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-14T19:18:08.000Z (over 8 years ago)
- Last Synced: 2025-02-23T15:11:15.569Z (10 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# customvision-find-video-tags
Use [Microsoft Custom Vision API](customvision.ai) to pin point frames in a video with the biggest probability for each tag.
This module will;
1. download the video
2. sample an image every second (configurable)
3. check for each image what's the probability for each tag (using customvision.ai)
4. for each tag, take the image with the highest probability
5. delete local temporary files
# Usage
```js
let { pinTagsInVideo } = require('customvision-find-video-tags');
pinTagsInVideo(
'https://southcentralus.api.cognitive.microsoft.com/customvision/v1.0/Prediction/52856430-0796-4d1b-a05b-b6a42dc14743/image',
'f49c5905ca3148cfb5a146a0bsa3adc9',
'http://location.com/urlpath/video.mp4',
[ 'front', 'back', 'side' ],
{ every_n_seconds: 0.5 },
(err, anchors) => {
console.log('done');
}
);
```
# Using ffmpeg
If you want to use ffmpeg without installing it locally, you can use [ffmpeg-ensure](https://github.com/CatalystCode/ffmpeg-ensure):
```js
let { ensureFFMPEG } = require('ffmpeg-ensure');
let { pinTagsInVideo } = require('customvision-find-video-tags');
ensureFFMPEG().then(() => {
pinTagsInVideo(
'https://southcentralus.api.cognitive.microsoft.com/customvision/v1.0/Prediction/52856430-0796-4d1b-a05b-b6a42dc14743/image',
'f49c5905ca3148cfb5a146a0bsa3adc9',
'http://location.com/urlpath/video.mp4',
[ 'front', 'back', 'side' ],
{ every_n_seconds: 0.5 },
(err, anchors) => {
console.log('done');
}
);
});
```