diff --git a/game/石头剪刀布/game.html b/game/石头剪刀布/game.html index 146de16..c1230c5 100644 --- a/game/石头剪刀布/game.html +++ b/game/石头剪刀布/game.html @@ -516,19 +516,19 @@ // 启动检测循环 startDetectionLoop(); - // 尝试从 CDN 加载模型 - try { - const cdnModelUrl = 'https://goood-space-assets.oss-cn-beijing.aliyuncs.com/public/models/hand-knn-model- 2.json'; - await loadKNNModelData(null, cdnModelUrl); - updateStatus('模型加载成功!可以开始游戏了'); - isModelLoaded = true; - startBtn.disabled = false; - importModelBtn.disabled = true; - } catch (cdnError) { - console.warn('CDN 模型加载失败:', cdnError); - updateStatus('CDN 模型加载失败,请手动导入模型'); - importModelBtn.disabled = false; - } + // // 尝试从 CDN 加载模型 + // try { + // const cdnModelUrl = 'https://goood-space-assets.oss-cn-beijing.aliyuncs.com/public/models/hand-knn-model-2.json'; + // await loadKNNModelData(null, cdnModelUrl); + // updateStatus('模型加载成功!可以开始游戏了'); + // isModelLoaded = true; + // startBtn.disabled = false; + // importModelBtn.disabled = true; + // } catch (cdnError) { + // console.warn('CDN 模型加载失败:', cdnError); + // updateStatus('CDN 模型加载失败,请手动导入模型'); + // importModelBtn.disabled = false; + // } } catch (error) { console.error('初始化失败:', error); diff --git a/game/钢琴/index.html b/game/钢琴/index.html index 34ff846..6739c0b 100644 --- a/game/钢琴/index.html +++ b/game/钢琴/index.html @@ -573,20 +573,20 @@ fileImporter.addEventListener('change', (event) => loadKNNModelData(event.target.files[0])); startStopBtn.addEventListener('click', togglePlaying); - // 尝试从 CDN 加载模型 - try { - const cdnJsonUrl = 'https://goood-space-assets.oss-cn-beijing.aliyuncs.com/public/models/hand-knn-model.json'; - await loadKNNModelData(null, cdnJsonUrl); - updateGlobalStatus('CDN 手势识别模型加载成功!'); - isModelLoaded = true; - importModelBtn.disabled = true; - startStopBtn.disabled = false; - } catch (cdnError) { - console.warn('CDN 模型加载失败:', cdnError); - updateGlobalStatus('请手动导入模型文件'); - importModelBtn.disabled = false; - startStopBtn.disabled = true; - } + // // 尝试从 CDN 加载模型 + // try { + // const cdnJsonUrl = 'https://goood-space-assets.oss-cn-beijing.aliyuncs.com/public/models/hand-knn-model.json'; + // await loadKNNModelData(null, cdnJsonUrl); + // updateGlobalStatus('CDN 手势识别模型加载成功!'); + // isModelLoaded = true; + // importModelBtn.disabled = true; + // startStopBtn.disabled = false; + // } catch (cdnError) { + // console.warn('CDN 模型加载失败:', cdnError); + // updateGlobalStatus('请手动导入模型文件'); + // importModelBtn.disabled = false; + // startStopBtn.disabled = true; + // } } catch (error) { console.error('应用初始化失败:', error); diff --git a/game/钢琴/sounds/新建 文本文档.txt b/game/钢琴/sounds/新建 文本文档.txt new file mode 100644 index 0000000..f15c02e --- /dev/null +++ b/game/钢琴/sounds/新建 文本文档.txt @@ -0,0 +1,8 @@ +
  • ID 0: 中央C (C2)
  • +
  • ID 1: D2
  • +
  • ID 2: E2
  • +
  • ID 3: F2
  • +
  • ID 4: G2
  • +
  • ID 5: A2
  • +
  • ID 6: B2
  • +
  • ID 7: 高音C (C3)
  • \ No newline at end of file diff --git a/姿态分类/index.html b/姿态分类/index.html index 28b2467..fa6051b 100644 --- a/姿态分类/index.html +++ b/姿态分类/index.html @@ -89,7 +89,8 @@ // 定义需要被劫持的原始 URL 的域名模式 const INTERCEPT_DOMAINS = [ - 'https://tfhub.dev/', + // 'https://tfhub.dev/', + 'https://tfhub.dev/google/tfjs-model/movenet/singlepose/lightning/4/', // 如果实际的最终模型文件仍然解析到 storage.googleapis.com,也需要包含 // 例如:'https://storage.googleapis.com/tfjs-models/' // 或者你观察到的实际的最终 Google Storage 域名 @@ -111,8 +112,8 @@ for (const domain of INTERCEPT_DOMAINS) { if (url.startsWith(domain)) { // 尝试从 URL 中提取文件名 (不包含查询参数) - // 匹配 model.json 或 group1-shardXofY.bin - const fileNameMatch = url.match(/(model\.json|group1-shard\dof\d\.bin)/); + // 匹配 model.json 或 group1-shardXof2.bin + const fileNameMatch = url.match(/(model\.json|group1-shard\dof2\.bin)/); if (fileNameMatch) { const fileName = fileNameMatch[0]; // 获取匹配到的文件名 newUrl = MIRROR_SPECIFIC_FILENAME_PREFIX + fileName; // 拼接新的镜像 URL @@ -192,6 +193,7 @@ })(); + diff --git a/完善KNN/knn-classifier.html b/完善KNN/knn-classifier.html index 8de6413..9672226 100644 --- a/完善KNN/knn-classifier.html +++ b/完善KNN/knn-classifier.html @@ -16,9 +16,8 @@ // 定义需要被劫持的原始 URL 的域名模式 // 我们观察到最终请求来自 storage.googleapis.com const INTERCEPT_DOMAINS = [ - 'https://storage.googleapis.com/tfjs-models/', // tfjs 官方模型常用的 CDN - 'https://storage.googleapis.com/', // 更宽泛的匹配 Google Storage - 'https://tfhub.dev/', // 如果 MobileNet 也会通过 tfhub.dev 间接加载 + // 'https://tfhub.dev/', // 如果 MobileNet 也会通过 tfhub.dev 间接加载 + 'https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/2/', ]; // 备份原始的 fetch 函数 @@ -38,7 +37,7 @@ if (url.startsWith(domain)) { // 尝试从 URL 中提取文件名 (不包含查询参数) // 匹配 model.json 或 group1-shardXofY.bin - const fileNameMatch = url.match(/(model\.json|group1-shard\dof\d\.bin)/); + const fileNameMatch = url.match(/(model\.json|group1-shard\dof4\.bin)/); if (fileNameMatch) { const fileName = fileNameMatch[0]; // 获取匹配到的文件名 newUrl = MOBILENET_MIRROR_BASE_URL + fileName; // 拼接新的镜像 URL @@ -128,6 +127,8 @@ })(); + + diff --git a/音频分类/voice.html b/音频分类/voice.html index 812a8f9..62b0d64 100644 --- a/音频分类/voice.html +++ b/音频分类/voice.html @@ -183,6 +183,7 @@ + +