π¨JavaScript SDK
Streamline working with your Pop on the web
Quick Start
πΎJavaScript SDK DemosSDK Usage
<form>
<input type="file" id="file_upload">
</form>
<video id="myLocalVideo" playsinline controls muted style="width:1px;height:1px;"></video>
<div style="height: 600px; width:600px;">
<canvas id="mobilecanvas" style="background-color: transparent; opacity: 1; margin:auto auto;z-index:1000;" width="100%" height="100%"></canvas>
</div>
<script src="https://cdn.jsdelivr.net/npm/@eyepop.ai/javascript-sdk"></script>
<script>
var config = {};
// replace with your endpoint UUID
const pop_uuid = '<POP_UUID>';
// leave this empty to launch a 'login' popup, or enter a temporary token
const token = '';
// first, fetch the Pop info
EyePopSDK.EyePopAPI.FetchPopConfig(pop_endpoint, token)
.then((response) => {
config = response;
config.input = {
"name": "file_upload"
};
console.log("EyePopSDK config: ", config);
// then start the Pop
EyePopSDK.EyePopSDK.init(config);
});
</script>API
Table of Contents
EyePopSDK
instance
instanceinit(config)
init(config)EyePopAPI
lastmsg
lastmsgOnDrawFrame()
OnDrawFrame()OnDrawFrameEnd(jsonData)
OnDrawFrameEnd(jsonData)OnPrediction(jsonData)
OnPrediction(jsonData)OnPredictionTarget()
OnPredictionTarget()OnPredictionEnd()
OnPredictionEnd()onPredictionEndBase()
onPredictionEndBase()Rules
FindObject(label, object)
FindObject(label, object)Biggest(label, object)
Biggest(label, object)Area(object, source_width, source_height)
Area(object, source_width, source_height)Between(x, min, max)
Between(x, min, max)Amount(label, objects)
Amount(label, objects)PosePoint(label, personObject)
PosePoint(label, personObject)Emotion(emotionLabel, personObject)
Emotion(emotionLabel, personObject)Gender(genderLabel, personObject)
Gender(genderLabel, personObject)Position(object1, direction, object2)
Position(object1, direction, object2)Check(resultSet, rules, rulesState)
Check(resultSet, rules, rulesState)Last updated