rtmlib-ts 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/package.json +4 -1
  2. package/.gitattributes +0 -1
  3. package/docs/ANIMAL_DETECTOR.md +0 -450
  4. package/docs/CUSTOM_DETECTOR.md +0 -568
  5. package/docs/OBJECT_DETECTOR.md +0 -373
  6. package/docs/POSE3D_DETECTOR.md +0 -458
  7. package/docs/POSE_DETECTOR.md +0 -442
  8. package/examples/README.md +0 -119
  9. package/examples/index.html +0 -746
  10. package/playground/README.md +0 -114
  11. package/playground/app/favicon.ico +0 -0
  12. package/playground/app/globals.css +0 -17
  13. package/playground/app/layout.tsx +0 -19
  14. package/playground/app/page.tsx +0 -1338
  15. package/playground/eslint.config.mjs +0 -18
  16. package/playground/next.config.ts +0 -34
  17. package/playground/package-lock.json +0 -6723
  18. package/playground/package.json +0 -27
  19. package/playground/postcss.config.mjs +0 -7
  20. package/playground/tsconfig.json +0 -34
  21. package/src/core/base.ts +0 -66
  22. package/src/core/file.ts +0 -141
  23. package/src/core/modelCache.ts +0 -189
  24. package/src/core/posePostprocessing.ts +0 -91
  25. package/src/core/postprocessing.ts +0 -93
  26. package/src/core/preprocessing.ts +0 -127
  27. package/src/index.ts +0 -69
  28. package/src/models/rtmpose.ts +0 -265
  29. package/src/models/rtmpose3d.ts +0 -289
  30. package/src/models/yolo12.ts +0 -220
  31. package/src/models/yolox.ts +0 -214
  32. package/src/solution/animalDetector.ts +0 -955
  33. package/src/solution/body.ts +0 -89
  34. package/src/solution/bodyWithFeet.ts +0 -89
  35. package/src/solution/customDetector.ts +0 -474
  36. package/src/solution/hand.ts +0 -52
  37. package/src/solution/index.ts +0 -10
  38. package/src/solution/objectDetector.ts +0 -816
  39. package/src/solution/pose3dDetector.ts +0 -890
  40. package/src/solution/poseDetector.ts +0 -892
  41. package/src/solution/poseTracker.ts +0 -172
  42. package/src/solution/wholebody.ts +0 -130
  43. package/src/solution/wholebody3d.ts +0 -125
  44. package/src/types/index.ts +0 -62
  45. package/src/visualization/draw.ts +0 -543
  46. package/src/visualization/skeleton/coco133.ts +0 -131
  47. package/src/visualization/skeleton/coco17.ts +0 -49
  48. package/src/visualization/skeleton/halpe26.ts +0 -71
  49. package/src/visualization/skeleton/hand21.ts +0 -52
  50. package/src/visualization/skeleton/index.ts +0 -10
  51. package/src/visualization/skeleton/openpose134.ts +0 -125
  52. package/src/visualization/skeleton/openpose18.ts +0 -48
  53. package/tsconfig.json +0 -32
@@ -1,114 +0,0 @@
1
- # rtmlib-ts Playground
2
-
3
- Interactive Next.js app for testing rtmlib-ts library features.
4
-
5
- ## Quick Start
6
-
7
- ```bash
8
- # Install dependencies
9
- npm install
10
-
11
- # Run development server
12
- npm run dev
13
-
14
- # Open in browser
15
- http://localhost:3000
16
- ```
17
-
18
- ## Features
19
-
20
- ### Object Detection
21
- - Detect any of 80 COCO classes
22
- - Filter by specific classes (person, car, dog, etc.)
23
- - Real-time camera support
24
- - Image upload
25
-
26
- ### Pose Estimation
27
- - 17 keypoints per person
28
- - Skeleton visualization
29
- - Real-time camera support
30
- - Image upload
31
-
32
- ## Usage
33
-
34
- 1. **Select Mode**: Choose between Object Detection or Pose Estimation
35
- 2. **Choose Input**:
36
- - Click "Use Camera" for live detection
37
- - Click "Upload Image" to process a file
38
- 3. **Select Classes** (Object Detection only):
39
- - Check specific classes to detect
40
- - Uncheck all to detect all 80 classes
41
- 4. **Click Detect**: Run inference and see results
42
-
43
- ## Models
44
-
45
- Models are served from `/public/models/`:
46
-
47
- ```
48
- public/models/
49
- ├── yolo/
50
- │ ├── yolov12n.onnx # Object detection
51
- │ └── yolov26n.onnx
52
- └── rtmpose/
53
- └── end2end.onnx # Pose estimation
54
- ```
55
-
56
- ## Tech Stack
57
-
58
- - **Framework**: Next.js 15 (App Router)
59
- - **Library**: rtmlib-ts (local import)
60
- - **Backend**: ONNX Runtime Web (WASM)
61
- - **Styling**: Inline CSS (no dependencies)
62
-
63
- ## Code Example
64
-
65
- ```typescript
66
- import { ObjectDetector, PoseDetector } from 'rtmlib-ts';
67
-
68
- // Object Detection
69
- const detector = new ObjectDetector({
70
- model: '/models/yolo/yolov12n.onnx',
71
- classes: ['person', 'car'],
72
- });
73
- await detector.init();
74
- const objects = await detector.detectFromCanvas(canvas);
75
-
76
- // Pose Estimation
77
- const poseDetector = new PoseDetector({
78
- detModel: '/models/yolo/yolov12n.onnx',
79
- poseModel: '/models/rtmpose/end2end.onnx',
80
- });
81
- await poseDetector.init();
82
- const people = await poseDetector.detectFromCanvas(canvas);
83
- ```
84
-
85
- ## Performance
86
-
87
- Expected inference times (varies by device):
88
-
89
- | Mode | Input | Time |
90
- |------|-------|------|
91
- | Object (WASM) | 640×640 | ~80ms |
92
- | Object (WebGPU) | 640×640 | ~30ms |
93
- | Pose (WASM) | 640×640 | ~150ms |
94
- | Pose (WebGPU) | 640×640 | ~60ms |
95
-
96
- ## Troubleshooting
97
-
98
- ### "Models not found"
99
- - Ensure models are in `public/models/`
100
- - Check browser console for 404 errors
101
-
102
- ### "Camera not working"
103
- - Grant camera permissions
104
- - Use HTTPS or localhost
105
- - Check browser compatibility
106
-
107
- ### "Slow inference"
108
- - Switch to WebGPU backend in code
109
- - Reduce input size
110
- - Use fewer classes
111
-
112
- ## License
113
-
114
- Apache 2.0
Binary file
@@ -1,17 +0,0 @@
1
- * {
2
- box-sizing: border-box;
3
- margin: 0;
4
- padding: 0;
5
- }
6
-
7
- body {
8
- background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
9
- color: #fff;
10
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
11
- min-height: 100vh;
12
- }
13
-
14
- @keyframes pulse {
15
- 0%, 100% { opacity: 1; }
16
- 50% { opacity: 0.7; }
17
- }
@@ -1,19 +0,0 @@
1
- import type { Metadata } from "next";
2
- import "./globals.css";
3
-
4
- export const metadata: Metadata = {
5
- title: "rtmlib-ts Playground",
6
- description: "Test Object Detection and Pose Estimation",
7
- };
8
-
9
- export default function RootLayout({
10
- children,
11
- }: Readonly<{
12
- children: React.ReactNode;
13
- }>) {
14
- return (
15
- <html lang="en">
16
- <body>{children}</body>
17
- </html>
18
- );
19
- }