mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 00:31:20 -08:00
Update index.js
This commit is contained in:
1 parent
a7599c41b5
commit
ffe4dd0d37
1 file changed
+1
-3
@@ -31,8 +31,7 @@ export default function artplayerPluginDanmukuMask(option = {}) {
|
|||||||
async function initTensorFlow() {
|
async function initTensorFlow() {
|
||||||
try {
|
try {
|
||||||
await tf.setBackend('webgl');
|
await tf.setBackend('webgl');
|
||||||
console.log('Using WebGL backend');
|
} catch (error) {
|
||||||
} catch (e) {
|
|
||||||
console.warn('WebGL backend not available, falling back to CPU');
|
console.warn('WebGL backend not available, falling back to CPU');
|
||||||
await tf.setBackend('cpu');
|
await tf.setBackend('cpu');
|
||||||
}
|
}
|
||||||
@@ -56,7 +55,6 @@ export default function artplayerPluginDanmukuMask(option = {}) {
|
|||||||
try {
|
try {
|
||||||
segmenter = await bodySegmentation.createSegmenter(model, segmenterConfig);
|
segmenter = await bodySegmentation.createSegmenter(model, segmenterConfig);
|
||||||
isInitialized = true;
|
isInitialized = true;
|
||||||
console.log('Segmenter initialized successfully');
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error initializing segmenter:', error);
|
console.error('Error initializing segmenter:', error);
|
||||||
isInitialized = false;
|
isInitialized = false;
|
||||||
|
|||||||
Reference in new issue
Block a user