Skip to content

Instantly share code, notes, and snippets.

"""
Contains variables for image-size, path of models and labels that are required by other modules
"""
IMAGE_SIZE = 50 # We'll be working with 50 * 50 pixel images
MODEL_PATH = "trained_model/bglessmodelv1.h5"
LABELS = ['A', 'C', 'E', 'H', 'I', 'L', 'O', 'U', 'V', 'W']
# Minimum confidence percentage i.e allowed for prediction
THRESHOLD = 30
var config = {
mode: "live",
codec: "h264"
}
var client = AgoraRTC.createClient(config);
function myfunction(){
let handlefail = function(err){
console.log("Error: ", err);
};
let remotecontainer = document.getElementById("remote");
let appid = document.getElementById("appid");
function addremotestream(streamid){
let newdiv = document.createElement("div");
function close(){
client.unpublish(localstream, function(err) {
console.log("unpublished!");
//……
})
client.leave(function() {
console.log("client leaves channel");
//……
}, function(err) {
console.log("client leave failed ", err);
async function start() {
console.log('Requesting local stream');
startButton.disabled = true;
try {
const stream = await navigator.mediaDevices.getUserMedia({audio: true, video: true});
console.log('Received local stream');
localVideo.srcObject = stream;
localStream = stream;
local_Video.srcObject = stream;
callButton.disabled = false;
async function call() {
callButton.disabled = true;
hangupButton.disabled = false;
console.log('Starting call');
startTime = window.performance.now();
const videoTracks = localStream.getVideoTracks();
const audioTracks = localStream.getAudioTracks();
if (videoTracks.length > 0) {
console.log(`Using video device: ${videoTracks[0].label}`);
}
const configuration = getSelectedSdpSemantics();
console.log('RTCPeerConnection configuration:', configuration);
pc1 = new RTCPeerConnection(configuration);
console.log('Created local peer connection object pc1');
pc1.addEventListener('icecandidate', e => onIceCandidate(pc1, e));
pc2 = new RTCPeerConnection(configuration);
console.log('Created remote peer connection object pc2');
pc2.addEventListener('icecandidate', e => onIceCandidate(pc2, e));
pc1.addEventListener('iceconnectionstatechange', e => onIceStateChange(pc1, e));
pc2.addEventListener('iceconnectionstatechange', e => onIceStateChange(pc2, e));
function hangup() {
console.log('Ending call');
pc1.close();
pc2.close();
pc1 = null;
pc2 = null;
hangupButton.disabled = true;
callButton.disabled = false;
}
var client = AgoraRTC.createClient(config);
function myfunction(){
let handlefail = function(err){
console.log("Error: ", err);
};
let remotecontainer = document.getElementById("remote1");
let remote_container = document.getElementById("remote2");
let appid = document.getElementById("appid");
function logger()
{
//initialize client
const client = AgoraRTM.createInstance(appid.value);
//check connection state
client.on('ConnectionStateChange', (newState, reason) => {
console.log('on connection state changed to ' + newState + ' reason: ' + reason);
});