文档

远程监考智能防作弊SDK

更新时间:

通过阅读本文,您可以了解远程监考场景下智能防作弊SDK详细信息。

SDK介绍

远程监考智能防作弊SDK是阿里云针对远程监考场景研发的一款智能监考SDK,可对考试场景中的各种可疑作弊行为通过AI进行智能检测。目前支持的检测行为有:

  • 考场人员检测:人数检测、人员进入/离开

  • 考生物品检测:打电话、戴帽子、戴手表、戴头式耳机、入耳式耳机

  • 考生行为检测:低头/抬头、转头/摇头、起立/坐下、举手

  • 人声检测:说话声音检测

环境要求

开发环境

开发环境

说明

VSCode

建议使用VSCode 1.60或以上版本。下载地址,请参见Visual Studio Code

Chrome

建议使用Chrome 94或以上版本。下载地址,请参见Chrome

运行环境

运行时各平台浏览器版本要求如下:

平台

Chrome

Edge

Safari

Windows

69+

16+

-

macOS

69+

16+

16+

Android

58+

all

-

iOS

69+

16+

16+

购买License

使用之前,您需要购买License

SDK使用示例

导入SDK

在页面中引入JS文件:

<script src="https://g.alicdn.com/apsara-media-box/imp-cheat-detection-wasm/1.0.1/aliyun-detect-engine.js"></script>

SDK初始化

const cheatEngine = new AliyunDetectEngine();
const config = {
    objectDetect: true, //电子设备检测
    scenePersonEnter: true, //人物进入
    scenePersonExit: true, //离开
    scenePersonInRectRatio: true, //画面占比

    actionHeadUpDown: true, //低/抬头
    actionHeadLeftRight: true, //转头
    actionHeadShaking: true, //摇头

    actionPoseStandup: true, //起立
    actionPoseSitting: true, //坐下
    actionPoseHandup: true, //举手
    actionPersonSpeech: true, //声音
    licenseKey: '',//sdk license
    licenseDomain: '' //sdk根域名
}
await cheatEngine.init(config);

基于摄像头流作弊检测

// 获取video元素
const video = document.querySelector('video');
// 获取摄像头
const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true })
video.srcObject = stream;
video.play();

cheatEngine.startDetect(video);
cheatEngine.on('detectResult', (jsonResult) => {
    console.info(jsonResult);
});

结果输出:

{
  "actionPersonSpeech": 1.0,
  "actionPoseHandup": 0,
  "actionPoseSitting": 0,
  "actionPoseStandup": 0,
  "faceCount": 1,
  "scenePersonInRectRatio": 0.13
}

参数

类型

说明

objectHeadPhone

number

戴头式耳机检测分值。

objectEarPhone

number

戴入耳式耳机检测分值。

objectDetectCellPhone

number

打电话检测分值。

objectDetectWatch

number

戴手表检测分值。

objectDetectHat

number

戴帽子检测分值。

scenePersonEnter

number

人物进入检测分值。

scenePersonExit

number

人物离开检测分值。

scenePersonInRectRatio

number

画面占比检测分值。

actionHeadUpDown

number

低/抬头检测分值。

actionHeadLeftRight

number

转头检测分值。

actionHeadShaking

number

摇头检测分值。

actionPoseStandup

number

起立检测分值。

actionPoseSitting

number

坐下检测分值。

actionPoseHandup

number

举手检测分值。

actionPersonSpeech

number

人声检测分值。

factCount

number

检测到的人数。

检测引擎注销

cheatEngine.destroy();

API说明

SDK初始化

/**
* SDK初始化
* @param options 检测参数配置
* @param renderCanvas 用于渲染输出检测点位的Canvas,可为空
* @returns 
*/
public async init(options: DetectInitOptions, renderCanvas?: HTMLCanvasElement)

DetectInitOptions 类型

interface DetectInitOptions {
  fps?: number; //检测帧率,默认为5。
  detectTimeout?: number; //单次检测超时时间,默认为5秒。
  objectDetect?: boolean; //是否启用电子设备检测。
  scenePersonEnter?: boolean; //是否启用人物进入检测。
  scenePersonExit?: boolean; //是否启用人物离开检测。
  scenePersonInRectRatio?: boolean; //是否启用画面占比检测。
  actionHeadUpDown?: boolean; //是否启用低/抬头检测。
  actionHeadLeftRight?: boolean; //是否启用转头检测。
  actionHeadShaking?: boolean; //是否启用摇头检测。
  actionPoseStandup?: boolean; //是否启用起立检测。
  actionPoseSitting?: boolean; //是否启用坐下检测。
  actionPoseHandup?: boolean; //是否启用举手检测。
  actionPersonSpeech?: boolean; //是否启用人声检测。
  detectSkipFrame?: number; //每隔多少帧检测一次。
  enableRender: boolean; //是否启用渲染支持。
  licenseKey?: string; //授权LcenseKey。
  licenseDomain?: string; //授权根域名。
}

作弊检测

/**
* 作弊行为动作检测
* @param mediaElement 媒体对象
* @returns 检测提交引擎是否成功,提交成功返回 true;当前正在检测或者被 fps 限制,则返回 false
*/
public startDetect(mediaElement: HTMLVideoElement)

引擎注销

/**
* 检测引擎注销
*/
destroy()

更新检测FPS帧率

/**
 * 用于设置每秒检测的帧率,即每秒检测多少次,默认为5fps
 * @param fps 检测限制 FPS
 */
public updateFpsLimit(fps: number): void

更新检测超时时间

/**
 * 用于配置每次检测的超时时间(毫秒),超时后直接返回检测失败
 * @param timeout 检测任务超时时间 毫秒
 */
public updateDetectTimeout(timeout: number): void

Demo体验

远程监考智能防作弊SDK Demo源码:ActionDetectionDemos_Web

  • 本页导读 (1)
文档反馈