This is a fork of neural-dream, a PyTorch implementation of DeepDream. This fork introduces optical flow estimation and occlusion masking to apply DeepDream to videos with temporal consistency. Features Standard DeepDream : The original single-image implementation. : The original single-image implementation. Video DeepDream : New CLI ( video_dream.py ) that uses RAFT Optical Flow to warp previous dream frames into the current frame, ensuring smooth transitions and object tracking. : New CLI ( ) that uses RAFT Optical Flow to warp previous dream frames into the current frame, ensuring smooth transitions and object tracking. Occlusion Masking: Automatically detects when objects move in front of one another to prevent "ghosting" artifacts. Demo With temporal consistency mallard_demo.mp4 highway_demo.mp4 With frames processed independently mallard_independent_demo.mp4 highway_independent_demo.mp4 Inputs mallard.mp4 highway.mp4 Setup Dependencies This project requires the following key packages: PyTorch torchvision OpenCV NumPy Pillow Install Dependencies: pip install -r requirements.txt Download Models: Run the download script to fetch the standard Inception/GoogLeNet models: python models/download_models.py To download all compatible models: python models/download_models.py -models all-caffe-googlenet Usage 1. Video DeepDream To dream on a video, use the video_dream.py script. This wrapper accepts specific video arguments and any argument accepted by the standard image dreamer (e.g., layers, octaves, iterations). Basic Video Command: python video_dream.py -content_video input.mp4 -output_video output.mp4 -num_iterations 1 Note: For video processing, we recommend using -num_iterations 1 . The temporal consistency from optical flow means each frame builds on the previous dream, so fewer iterations per frame are needed compared to single images. Video-Specific Arguments: Argument Default Description -content_video input.mp4 Path to the source video file. -output_video out...
First seen: 2026-01-08 14:47
Last seen: 2026-01-08 21:49