yootd 0.0.90 → 0.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -1
- package/dist/index.js +2 -1
- package/dist/video-player/index.js +11 -11
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -171,7 +171,6 @@ export { UserDropdown } from './user-dropdown';
|
|
171
171
|
export type { UserDropdownProps } from './user-dropdown/types/types';
|
172
172
|
export { ConfigProvider } from './config-provider';
|
173
173
|
export type { ConfigProviderProps } from './config-provider';
|
174
|
-
export { Zone } from './zones';
|
175
174
|
export { GoBack } from './go-back';
|
176
175
|
export type { GoBackProps } from './go-back';
|
177
176
|
export { VideoPlayer } from './video-player';
|
package/dist/index.js
CHANGED
@@ -92,6 +92,7 @@ export { DatePicker } from "./date-picker";
|
|
92
92
|
export { Teacher } from "./teacher";
|
93
93
|
export { UserDropdown } from "./user-dropdown";
|
94
94
|
export { ConfigProvider } from "./config-provider";
|
95
|
-
export { Zone } from
|
95
|
+
// export { Zone } from './zones';
|
96
|
+
|
96
97
|
export { GoBack } from "./go-back";
|
97
98
|
export { VideoPlayer } from "./video-player";
|
@@ -146,8 +146,8 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
146
146
|
setOptions = _useState34[1];
|
147
147
|
var _useState35 = useState(false),
|
148
148
|
_useState36 = _slicedToArray(_useState35, 2),
|
149
|
-
|
150
|
-
|
149
|
+
faceApiInitialized = _useState36[0],
|
150
|
+
setFaceApiInitialized = _useState36[1];
|
151
151
|
var _useState37 = useState({
|
152
152
|
width: 0,
|
153
153
|
height: 0
|
@@ -168,7 +168,6 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
168
168
|
setIsSeeking = _useState42[1];
|
169
169
|
var _useState43 = useState(false),
|
170
170
|
_useState44 = _slicedToArray(_useState43, 2),
|
171
|
-
isError = _useState44[0],
|
172
171
|
setIsError = _useState44[1];
|
173
172
|
var _useState45 = useState(),
|
174
173
|
_useState46 = _slicedToArray(_useState45, 2),
|
@@ -449,9 +448,9 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
449
448
|
}
|
450
449
|
if (faceFeature.emotion) {
|
451
450
|
var _emotionMap;
|
452
|
-
ctx.fillText("
|
451
|
+
ctx.fillText("".concat( // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
453
452
|
// @ts-expect-error
|
454
|
-
(_emotionMap = emotionMap[expression[0][0]]) !== null && _emotionMap !== void 0 ? _emotionMap : ''), person.detection.box.x, person.detection.box.y - 20
|
453
|
+
(_emotionMap = emotionMap[expression[0][0]]) !== null && _emotionMap !== void 0 ? _emotionMap : '', " ").concat(Math.round(100 * expression[0][1]), "% "), person.detection.box.x, person.detection.box.y - 20
|
455
454
|
// person.detection.box.y - 42
|
456
455
|
);
|
457
456
|
}
|
@@ -480,7 +479,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
480
479
|
}, []);
|
481
480
|
var detectFaces = useCallback(function () {
|
482
481
|
return new Promise(function (resolve, reject) {
|
483
|
-
if (videoRef.current != null && detectAllFacesRef.current != null && options != null &&
|
482
|
+
if (videoRef.current != null && detectAllFacesRef.current != null && options != null && faceApiInitialized) {
|
484
483
|
var t0 = performance.now();
|
485
484
|
detectAllFacesRef.current(videoRef.current, options).withFaceLandmarks().withFaceExpressions().withAgeAndGender()
|
486
485
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
@@ -500,7 +499,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
500
499
|
});
|
501
500
|
|
502
501
|
// 肢体检测
|
503
|
-
}, [drawFaces,
|
502
|
+
}, [drawFaces, faceApiInitialized, aiFeature, options]);
|
504
503
|
var drawKeyPoints = function drawKeyPoints(keypoints, ctx) {
|
505
504
|
keypoints.forEach(function (keypoint) {
|
506
505
|
if (keypoint.score && keypoint.score > 0.3) {
|
@@ -619,6 +618,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
619
618
|
|
620
619
|
// 获取具体的错误代码
|
621
620
|
var error = video.error;
|
621
|
+
console.log('发生错误', error);
|
622
622
|
setIsError(true);
|
623
623
|
if (error) {
|
624
624
|
switch (error.code) {
|
@@ -677,7 +677,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
677
677
|
console.error('tensorflow 加载失败: ', _context2.t0);
|
678
678
|
case 17:
|
679
679
|
_context2.prev = 17;
|
680
|
-
if (!((aiFeature.anchor || aiFeature.emotion || aiFeature.character) && !
|
680
|
+
if (!((aiFeature.anchor || aiFeature.emotion || aiFeature.character) && !faceApiInitialized)) {
|
681
681
|
_context2.next = 35;
|
682
682
|
break;
|
683
683
|
}
|
@@ -705,7 +705,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
705
705
|
maxResults: MAX_RESULTS
|
706
706
|
}));
|
707
707
|
detectAllFacesRef.current = faceapi.detectAllFaces;
|
708
|
-
|
708
|
+
setFaceApiInitialized(true);
|
709
709
|
case 35:
|
710
710
|
_context2.next = 40;
|
711
711
|
break;
|
@@ -752,7 +752,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
752
752
|
return function () {
|
753
753
|
loaded = false;
|
754
754
|
};
|
755
|
-
}, [aiFeature,
|
755
|
+
}, [aiFeature, faceApiInitialized, poseDetector, tfInitialized]);
|
756
756
|
useEffect(function () {
|
757
757
|
var player = null;
|
758
758
|
if (isLive && videoRef.current != null) {
|
@@ -908,7 +908,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
908
908
|
,
|
909
909
|
onSeeked: handleSeeked,
|
910
910
|
onError: handleVideoError
|
911
|
-
})), controls === true && show &&
|
911
|
+
})), controls === true && show && /*#__PURE__*/React.createElement("div", {
|
912
912
|
className: "".concat(bem.b('container').e('controls'))
|
913
913
|
}, /*#__PURE__*/React.createElement("div", {
|
914
914
|
className: "".concat(bem.b('container').e('mask')),
|