1 Star 0 Fork 0

db/sd-webui-3d-open-pose-editor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
compress.ts 724 Bytes
一键复制 编辑 原始数据 按行查看 历史
nonnonstop 提交于 2年前 . Revert to upstream
import avsc from 'avsc'
import fs from 'fs-extra'
const data = fs.readJSONSync('src/poses/data.json')
const data0: [number, number, number][][] = data
.map((i) =>
i.map((value) => {
if (value) {
return [
Math.round(value[0] * 1000),
Math.round(value[1] * 1000),
Math.round(value[2] * 1000),
]
} else return [0, 0, 0]
})
)
.filter((i) => {
const [a, b, c] = i[1]
return b > 30 * 1000
})
const int32Buffer = new Int32Array(data0.flat(2))
fs.writeFileSync('src/poses/data.bin', Buffer.from(int32Buffer.buffer))
console.log(data0.length, int32Buffer.byteLength)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dbscholar0/sd-webui-3d-open-pose-editor.git
git@gitee.com:dbscholar0/sd-webui-3d-open-pose-editor.git
dbscholar0
sd-webui-3d-open-pose-editor
sd-webui-3d-open-pose-editor
main

搜索帮助