Welcome to the Invisibility Cloak project repository! This repository contains two implementations of an invisibility cloak using computer vision and machine learning techniques:
- OpenCV-based implementation
- PyTorch-based implementation
Both implementations are provided as Jupyter Notebook (.ipynb) files for an interactive and easy-to-follow demonstration of the concepts.
The goal of this project is to simulate an invisibility cloak effect, similar to what you've seen in movies. By detecting a specific color (e.g., red) in a video stream, the code masks the cloak region and replaces it with the background, creating the illusion of invisibility.
- Real-time color detection and masking.
- Background capture for seamless cloaking.
- Interactive visualization using Jupyter Notebook.
InvisibilityCloak using OpenCV.ipynb: Implementation using OpenCV's image processing techniques.InvisibilityCloak_using_Pytorch.ipynb: Implementation leveraging PyTorch for additional machine learning capabilities.
To run the projects, ensure you have the following installed:
- Python 3.7 or later
- Jupyter Notebook
opencv-pythonnumpy
torchtorchvisionnumpyopencv-python
You can install the required libraries using pip:
pip install opencv-python numpy torch torchvision-
Clone the repository to your local machine:
git clone https://github.com/your-username/invisibility-cloak.git cd invisibility-cloak -
Launch Jupyter Notebook:
jupyter notebook
-
Open and run either of the following notebooks:
Invisibility_Cloak_OpenCV.ipynbInvisibility_Cloak_PyTorch.ipynb
-
Follow the instructions within the notebook to run the project.
- Make sure your camera is connected and accessible.
- Use a brightly colored cloak (e.g., red) for the best results.
- Run the notebook cells sequentially to set up the cloak effect.
- Enhance cloak detection using deep learning-based segmentation.
- Support for multiple cloak colors.
- Improve background capture for dynamic environments.
Contributions are welcome! Feel free to fork the repository and submit a pull request.
Enjoy experimenting with the invisibility cloak effect! 🚀