mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
feat: fix MODEL_URL in FaceRecognitionModal
This commit is contained in:
parent
56bcef0592
commit
e2eafa909b
@ -17,6 +17,7 @@ import React, {useState} from "react";
|
|||||||
import {Button, Modal, Progress, Space, Spin, message} from "antd";
|
import {Button, Modal, Progress, Space, Spin, message} from "antd";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import Dragger from "antd/es/upload/Dragger";
|
import Dragger from "antd/es/upload/Dragger";
|
||||||
|
import * as Setting from "../../Setting";
|
||||||
|
|
||||||
const FaceRecognitionModal = (props) => {
|
const FaceRecognitionModal = (props) => {
|
||||||
const {visible, onOk, onCancel, withImage} = props;
|
const {visible, onOk, onCancel, withImage} = props;
|
||||||
@ -35,9 +36,8 @@ const FaceRecognitionModal = (props) => {
|
|||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const loadModels = async() => {
|
const loadModels = async() => {
|
||||||
// const MODEL_URL = process.env.PUBLIC_URL + "/models";
|
|
||||||
// const MODEL_URL = "https://justadudewhohacks.github.io/face-api.js/models";
|
// const MODEL_URL = "https://justadudewhohacks.github.io/face-api.js/models";
|
||||||
const MODEL_URL = "https://cdn.casdoor.com/casdoor/models";
|
const MODEL_URL = `${Setting.StaticBaseUrl}/casdoor/models`;
|
||||||
|
|
||||||
Promise.all([
|
Promise.all([
|
||||||
faceapi.nets.tinyFaceDetector.loadFromUri(MODEL_URL),
|
faceapi.nets.tinyFaceDetector.loadFromUri(MODEL_URL),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user