A prototype repo. Demo here. Currently implements
I know this is a prototype but it's pretty useful as a demo
git clone https://github.com/ThatXliner/pushup-counter-sveltekit.git
cd pushup-counter-sveltekit
bun install # Install bun if needed (https://bun.sh)
Create a new workout named <workout>.ts
where <WORKOUT>
is the name of the workout. Make it export default
a class that extends Workout
(which is an abstract class in src/lib/workouts/index.ts
).
Dev server:
bun run dev
Update tests/assets/accuracy_test.ts
with this at the bottom
+ test('<WORKOUT> model accuracy', async () => {
+ await runModel('<WORKOUT>', new <WORKOUT>());
+ });
Where <WORKOUT>
is the name of the workout. Then convert your video of yourself into frames. Create frames with
ffmpeg -i input.mp4 -r 30 -vf scale="iw/2:ih/2" frame_%04d.jpg
INSIDE the directory that stores the frames. Here, 30 is the framerate (and should always be 30 fps). The -vf scale="iw/2:ih/2"
scales the image to half the size (optional).
To create a production version of your app:
bun run build
You can preview the production build with bun run preview
.
To deploy your app, you may need to install an adapter for your target environment.