This project enables users to train a machine learning model in their browser using Transfer Learning with TensorFlow.js and MobileNet v3. Users can teach the model to recognize objects from the webcam feed by collecting samples in real-time. This approach ensures privacy and immediacy, as no data is sent to a server.
- Real-time data collection and model training in the browser.
- Utilizes TensorFlow.js and MobileNet v3 for efficient, client-side machine learning.
- Supports multiple classes of objects for recognition.
- No server-side processing required, ensuring user privacy.
- A modern web browser with support for JavaScript and TensorFlow.js.
- Internet connection for loading TensorFlow.js library.
- Clone this repository or download the provided files (
index.html
,script.js
,style.css
). - Ensure the files are in the same directory to maintain correct path references.
- Open
index.html
in a web browser. - Allow webcam access when prompted.
- Enable the webcam by clicking the "Enable Webcam" button.
- Collect data for Class 1 by pointing the webcam at an object and clicking the "Gather Class 1 Data" button. Aim for at least 30 samples.
- Repeat the process for Class 2 with a different object.
- Train the model by clicking the "Train & Predict!" button.
- Once trained, the model will make live predictions as the webcam feeds new images.
No additional configuration is required for basic usage. Advanced users can modify script.js
to tweak model parameters or add more classes.
Contributions to improve the project are welcome. You can contribute by:
- Submitting issues for bugs or suggestions.
- Proposing enhancements through pull requests.
Please follow standard coding practices and provide clear descriptions of your contributions.
This project is released under the Apache License 2.0. You are free to use, modify, and distribute the software under the terms of this license. Please see the LICENSE file for detailed information.
For further information or support, please open an issue on the project's GitHub page.