Update index.js

This commit is contained in:
Harvey Zack committed 2024-10-08 12:05:48 +08:00
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;