react-native-vision-camera-spoof-detector 1.0.18 → 1.0.20

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.
package/.npmignore ADDED
@@ -0,0 +1,99 @@
1
+ # npm ignore patterns - files that should not be published to npm
2
+
3
+ # Development files
4
+ .git
5
+ .gitignore
6
+ .gitattributes
7
+
8
+ # Development dependencies
9
+ node_modules
10
+ npm-debug.log*
11
+ yarn-debug.log*
12
+ yarn-error.log*
13
+
14
+ # IDE / Editor files
15
+ .vscode
16
+ .idea
17
+ .DS_Store
18
+ *.swp
19
+ *.swo
20
+ *~
21
+ .env
22
+ .env.local
23
+
24
+ # Build artifacts and temporary files
25
+ build/
26
+ dist/
27
+ .rollup.cache/
28
+ .eslintcache
29
+ *.tsbuildinfo
30
+
31
+ # Android build artifacts and caches
32
+ android/build/
33
+ android/.gradle/
34
+ android/.kotlin/
35
+ android/*.log
36
+ *.apk
37
+ *.aar
38
+ *.so
39
+
40
+ # Testing
41
+ __tests__
42
+ __mocks__
43
+ *.test.ts
44
+ *.test.tsx
45
+ *.spec.ts
46
+ *.spec.tsx
47
+ coverage
48
+ .jest
49
+
50
+ # Documentation (optional - remove if you want to publish docs)
51
+ docs/*.md
52
+ .docs/
53
+
54
+ # Example files (optional - remove if you want to include examples)
55
+ example/
56
+ examples/
57
+ demo/
58
+
59
+ # CI/CD
60
+ .github/workflows
61
+ .gitlab-ci.yml
62
+ .travis.yml
63
+ azure-pipelines.yml
64
+
65
+ # Root level files
66
+ .prettierrc
67
+ .prettierignore
68
+ .eslintrc
69
+ .eslintignore
70
+ .babelrc
71
+ tsconfig.json
72
+ jest.config.js
73
+ babel.config.js
74
+ webpack.config.js
75
+ Makefile
76
+
77
+ # Contribution files
78
+ CONTRIBUTING.md
79
+ CODE_OF_CONDUCT.md
80
+ PULL_REQUEST_TEMPLATE.md
81
+
82
+ # Misc
83
+ *.map
84
+ .npmrc
85
+ .yarnrc
86
+ .DS_Store
87
+ Thumbs.db
88
+ *.lock
89
+ package-lock.json
90
+ yarn.lock
91
+
92
+ # Keep essential files
93
+ !android/
94
+ !index.js
95
+ !index.d.ts
96
+ !README.md
97
+ !CHANGELOG.md
98
+ !LICENSE
99
+ !package.json
package/CHANGELOG.md ADDED
@@ -0,0 +1,148 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Coming Soon
11
+ - iOS support
12
+ - Web platform support
13
+ - TensorFlow Lite model optimization
14
+ - Custom model support
15
+
16
+ ## [1.0.18] - 2024-03-24
17
+
18
+ ### Added
19
+ - Comprehensive README with complete API documentation
20
+ - Advanced usage examples with full feature set
21
+ - TypeScript type definitions for all public APIs
22
+ - CHANGELOG.md for version tracking
23
+ - Contributing guidelines
24
+ - Performance optimization tips
25
+ - Troubleshooting guide
26
+
27
+ ### Changed
28
+ - Updated package.json with better metadata
29
+ - Improved npm package visibility
30
+ - Enhanced documentation structure
31
+ - Better error handling examples
32
+
33
+ ### Fixed
34
+ - Better error messages for initialization failures
35
+ - Improved frame release handling
36
+
37
+ ## [1.0.17] - 2024-03-20
38
+
39
+ ### Added
40
+ - Blink detection for enhanced liveness verification
41
+ - Face centering validation
42
+ - Customizable anti-spoofing thresholds
43
+
44
+ ### Improved
45
+ - Performance optimization with batched updates
46
+ - Memory management for frame processing
47
+ - GPU acceleration support
48
+
49
+ ## [1.0.16] - 2024-03-15
50
+
51
+ ### Added
52
+ - Face stability tracking
53
+ - Consecutive live frame detection
54
+ - Laplacian score calculation
55
+
56
+ ### Fixed
57
+ - Frame release memory leak
58
+ - State reset on component unmount
59
+
60
+ ## [1.0.0] - 2024-03-01
61
+
62
+ ### Added
63
+ - Initial release
64
+ - Face anti-spoofing detection
65
+ - TensorFlow Lite integration with GPU acceleration
66
+ - YUV frame processing optimization
67
+ - Real-time frame processor
68
+ - Confidence scoring
69
+ - Print attack detection
70
+ - Display attack detection
71
+ - Mask attack detection
72
+ - Replay attack detection
73
+
74
+ ### Features
75
+ - High-performance real-time detection
76
+ - Multi-model ensemble for better accuracy
77
+ - Optimized for React Native Vision Camera
78
+ - Support for Android platform
79
+
80
+ ---
81
+
82
+ ## Development Versions
83
+
84
+ ### Version History
85
+
86
+ #### v1.0.18 (Latest)
87
+ - Full npm publishing support
88
+ - Complete documentation
89
+ - TypeScript support
90
+ - Better examples
91
+
92
+ #### v1.0.0 - v1.0.17
93
+ - Initial development
94
+ - Core functionality
95
+ - Bug fixes and optimizations
96
+
97
+ ## Versioning
98
+
99
+ We use [Semantic Versioning](https://semver.org/):
100
+ - **MAJOR**: Breaking changes
101
+ - **MINOR**: New features (backward compatible)
102
+ - **PATCH**: Bug fixes and improvements
103
+
104
+ ## Future Roadmap
105
+
106
+ ### Phase 2 (Next Release)
107
+ - [ ] iOS native implementation
108
+ - [ ] Improved accuracy metrics
109
+ - [ ] Custom model support
110
+ - [ ] Advanced analytics
111
+
112
+ ### Phase 3 (Later)
113
+ - [ ] Web platform support
114
+ - [ ] Server-side verification
115
+ - [ ] Cross-platform examples
116
+ - [ ] Integration templates
117
+
118
+ ## Migration Guides
119
+
120
+ ### Upgrading from 1.0.0 to 1.0.18
121
+ - Install peer dependencies if not already installed
122
+ - No breaking API changes
123
+ - Update example code for enhanced features
124
+
125
+ ### Future Breaking Changes
126
+ None planned for the 1.0.x series.
127
+
128
+ ## Support & Issues
129
+
130
+ - Report bugs: [GitHub Issues](https://github.com/jescon-tech/react-native-vision-camera-spoof-detector/issues)
131
+ - Feature requests: [GitHub Discussions](https://github.com/jescon-tech/react-native-vision-camera-spoof-detector/discussions)
132
+
133
+ ## Contributing
134
+
135
+ Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for details on:
136
+ - How to submit issues
137
+ - How to submit pull requests
138
+ - Development setup
139
+ - Code standards
140
+
141
+ ## License
142
+
143
+ MIT License - See [LICENSE](./LICENSE) file for details
144
+
145
+ ---
146
+
147
+ Last Updated: March 24, 2024
148
+ Maintained by: JESCON TECHNOLOGIES PVT LTD
@@ -0,0 +1,280 @@
1
+ # Contributing to react-native-vision-camera-spoof-detector
2
+
3
+ First off, thank you for considering contributing to **react-native-vision-camera-spoof-detector**! It's people like you that make this library such a great tool.
4
+
5
+ ## Code of Conduct
6
+
7
+ This project and everyone participating in it is governed by our [Code of Conduct](./CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
8
+
9
+ ## How Can I Contribute?
10
+
11
+ ### Reporting Bugs
12
+
13
+ Before creating bug reports, please check the issue list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
14
+
15
+ - **Use a clear and descriptive title**
16
+ - **Describe the exact steps which reproduce the problem** in as many details as possible
17
+ - **Provide specific examples to demonstrate the steps**
18
+ - **Describe the behavior you observed after following the steps**
19
+ - **Explain which behavior you expected to see instead and why**
20
+ - **Include screenshots and animated GIFs** if possible
21
+ - **Include your environment details**:
22
+ - React Native version
23
+ - Device/OS version
24
+ - Library version
25
+ - Any relevant plugin versions
26
+
27
+ ### Suggesting Enhancements
28
+
29
+ Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
30
+
31
+ - **Use a clear and descriptive title**
32
+ - **Provide a step-by-step description of the suggested enhancement**
33
+ - **Provide specific examples to demonstrate the steps**
34
+ - **Describe the current behavior** and **the expected behavior**
35
+ - **Explain why this enhancement would be useful**
36
+
37
+ ### Pull Requests
38
+
39
+ - Fill in the required template
40
+ - Follow the TypeScript/JavaScript styleguides
41
+ - End all files with a newline
42
+ - Avoid platform-dependent code
43
+
44
+ ## Development Setup
45
+
46
+ ### Prerequisites
47
+
48
+ - Node.js >= 16.0.0
49
+ - npm >= 8.0.0 or yarn
50
+ - React Native >= 0.60.0
51
+ - Android SDK (for Android development)
52
+ - Xcode (for iOS development, when available)
53
+
54
+ ### Installation
55
+
56
+ 1. **Fork the repository**
57
+
58
+ ```bash
59
+ git clone https://github.com/YOUR_USERNAME/react-native-vision-camera-spoof-detector.git
60
+ cd react-native-vision-camera-spoof-detector
61
+ ```
62
+
63
+ 2. **Install dependencies**
64
+
65
+ ```bash
66
+ npm install
67
+ # or
68
+ yarn install
69
+ ```
70
+
71
+ 3. **Install peer dependencies**
72
+
73
+ ```bash
74
+ npm install react-native-vision-camera react-native-reanimated react-native-worklets-core
75
+ ```
76
+
77
+ 4. **Set up development environment**
78
+
79
+ For Android development, ensure your Android SDK is properly configured.
80
+
81
+ ### Building and Testing
82
+
83
+ ```bash
84
+ # Build the project
85
+ npm run build
86
+
87
+ # Run type checking
88
+ npm run type-check
89
+
90
+ # Run linter
91
+ npm run lint
92
+
93
+ # Run tests
94
+ npm run test
95
+
96
+ # Watch mode for development
97
+ npm run dev
98
+ ```
99
+
100
+ ## Styleguides
101
+
102
+ ### Git Commit Messages
103
+
104
+ - Use the present tense ("Add feature" not "Added feature")
105
+ - Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
106
+ - Limit the first line to 72 characters or less
107
+ - Reference issues and pull requests liberally after the first line
108
+ - Consider starting the commit message with an applicable emoji:
109
+ - 🎨 `:art:` - Improving structure/format
110
+ - 🐛 `:bug:` - Bug fix
111
+ - ⚡ `:zap:` - Performance improvement
112
+ - 📚 `:books:` - Documentation
113
+ - ✅ `:white_check_mark:` - Tests
114
+ - 🔧 `:wrench:` - Configuration
115
+ - 🚀 `:rocket:` - New feature
116
+ - 🔒 `:lock:` - Security
117
+ - ♻️ `:recycle:` - Refactoring
118
+
119
+ ### JavaScript/TypeScript Styleguide
120
+
121
+ All code must adhere to the following standards:
122
+
123
+ - Use TypeScript for all new code
124
+ - Write clear, self-documenting code
125
+ - Use meaningful variable and function names
126
+ - Add JSDoc comments for public APIs
127
+ - Follow ESLint configuration
128
+ - Maximum line length: 100 characters
129
+ - Use semicolons
130
+ - Use single quotes for strings
131
+ - Use 2 spaces for indentation
132
+
133
+ #### Example:
134
+
135
+ ```typescript
136
+ /**
137
+ * Detects if face is centered in frame
138
+ * @param faceRect - Face rectangle bounds
139
+ * @param frameWidth - Frame width in pixels
140
+ * @param frameHeight - Frame height in pixels
141
+ * @returns True if face is centered
142
+ */
143
+ export const isFaceCentered = (
144
+ faceRect: FaceRect,
145
+ frameWidth: number,
146
+ frameHeight: number
147
+ ): boolean => {
148
+ const faceCenterX = faceRect.x + faceRect.width / 2;
149
+ const faceCenterY = faceRect.y + faceRect.height / 2;
150
+ const frameCenterX = frameWidth / 2;
151
+ const frameCenterY = frameHeight / 2;
152
+
153
+ return (
154
+ Math.abs(faceCenterX - frameCenterX) <= frameWidth * 0.2 &&
155
+ Math.abs(faceCenterY - frameCenterY) <= frameHeight * 0.15
156
+ );
157
+ };
158
+ ```
159
+
160
+ ### Documentation Styleguide
161
+
162
+ - Use Markdown
163
+ - Reference functions/classes/methods with backticks: `functionName()`
164
+ - Use code blocks with language identifiers: \`\`\`javascript
165
+ - Include examples where applicable
166
+ - Keep paragraphs short and scannable
167
+
168
+ ## Testing
169
+
170
+ ### Writing Tests
171
+
172
+ All code changes should include corresponding tests:
173
+
174
+ ```typescript
175
+ describe('isFaceCentered', () => {
176
+ it('should return true when face is centered', () => {
177
+ const faceRect = { x: 75, y: 50, width: 50, height: 50 };
178
+ const result = isFaceCentered(faceRect, 200, 200);
179
+ expect(result).toBe(true);
180
+ });
181
+
182
+ it('should return false when face is off-center', () => {
183
+ const faceRect = { x: 10, y: 10, width: 50, height: 50 };
184
+ const result = isFaceCentered(faceRect, 200, 200);
185
+ expect(result).toBe(false);
186
+ });
187
+ });
188
+ ```
189
+
190
+ ### Running Tests
191
+
192
+ ```bash
193
+ npm run test
194
+
195
+ # Watch mode
196
+ npm run test:watch
197
+
198
+ # Coverage
199
+ npm run test:coverage
200
+ ```
201
+
202
+ ## Documentation Updates
203
+
204
+ If your changes affect the documented behavior, please update the README or relevant documentation files. This includes:
205
+
206
+ - New APIs
207
+ - Changed behavior
208
+ - New examples
209
+ - Configuration options
210
+
211
+ ## Performance Considerations
212
+
213
+ When adding new features, consider:
214
+
215
+ - Impact on frame processing performance
216
+ - Memory usage and garbage collection
217
+ - GPU vs CPU acceleration trade-offs
218
+ - Compatibility with older devices
219
+
220
+ ## Accessibility
221
+
222
+ - Ensure code is accessible to developers with different levels of experience
223
+ - Write clear comments for complex logic
224
+ - Provide examples for new features
225
+
226
+ ## Community
227
+
228
+ - Use inclusive language
229
+ - Be respectful and professional
230
+ - Help other contributors when possible
231
+ - Share knowledge and experience
232
+
233
+ ## Additional Notes
234
+
235
+ ### Code Review Process
236
+
237
+ 1. Automated tests must pass
238
+ 2. Code must follow style guidelines
239
+ 3. Documentation must be updated
240
+ 4. At least one maintainer review required
241
+ 5. All conversations must be professional
242
+
243
+ ### Priorities
244
+
245
+ When choosing what to work on:
246
+
247
+ 1. **High Priority**: Bug fixes, security issues
248
+ 2. **Medium Priority**: Feature enhancements, performance improvements
249
+ 3. **Low Priority**: Documentation, examples, refactoring
250
+
251
+ ## License
252
+
253
+ By contributing, you agree that your contributions will be licensed under its MIT License.
254
+
255
+ ## Recognition
256
+
257
+ Contributors will be recognized in:
258
+
259
+ - README.md contributors section
260
+ - CHANGELOG.md release notes
261
+ - GitHub contributors page
262
+
263
+ ## Questions?
264
+
265
+ - 📧 Email: jescontechnologies@gmail.com
266
+ - 💬 [GitHub Issues](https://github.com/jescon-tech/react-native-vision-camera-spoof-detector/issues)
267
+ - 📝 [GitHub Discussions](https://github.com/jescon-tech/react-native-vision-camera-spoof-detector/discussions)
268
+
269
+ ## Additional Resources
270
+
271
+ - [React Native Documentation](https://reactnative.dev/)
272
+ - [Vision Camera Documentation](https://react-native-vision-camera.com/)
273
+ - [TensorFlow Lite Guide](https://www.tensorflow.org/lite)
274
+ - [TypeScript Handbook](https://www.typescriptlang.org/docs/)
275
+
276
+ ---
277
+
278
+ Thank you for contributing! 🙏
279
+
280
+ Made with ❤️ by JESCON TECHNOLOGIES PVT LTD