Cinecomic is an automated movie-to-comic generator. Input a video and it generates a comic book for the same complete with a comic style and dialogue bubbles
Cinecomic.Demo.Video.mp4
Our project consists of the following core modules:
- Subtitle Generation
- Create a subtitle file for the input video using Whisper model
- Keyframe Extraction
- Frame Sampling: Samples frames at a set frequency from videos.
- Feature Extraction: Utilizes deep learning models like GoogLeNet v1 to extract features from frames.
- Highlightness Score Calculation: Deep Summarization Network (DSN) computes scores to identify keyframes.
- Dialogue Grouping: Groups frames based on dialogues to select significant keyframes.
- Panel Layout Generation
- Calculates the Region of Interest of a frame
- Selects a page layout template
- Crops frame to be accomodated into template
- Balloon Generation & Placement
- Analysis of emotions in subtitles determines speech balloon shape.
- Balloon placement involves using the "Dlib" face-detector library to detect characters' mouth positions in frames and placing at regions with relatively lesser ROI.
- Cartoonization
- Applies style transfer algorithms to enhance keyframes visually, mimicking traditional comics.
Read the project report for detailed explanations
- Python
- Install Pytorch
- Install dlib
- All dependencies mentioned in
requirements.txt
to be installed. (pip install -r requirements.txt
)
- If you are not using a GPU, head over to
backend/keyframes/keyframes.py
and setgpu=False
(At exactly 2 locations) - You can head over to
backend/subtitles/subs.py
and change the Whisper model used. (Check supported models here) - Run the flask server:
python -m flask --app app run
- Open the localhost link on your browser (Eg:
http://127.0.0.1:5000
)
![](https://private-user-images.githubusercontent.com/30729856/332444862-273277fb-fdb8-478d-ac14-8f5502e69ea9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg3OTU4NzUsIm5iZiI6MTcxODc5NTU3NSwicGF0aCI6Ii8zMDcyOTg1Ni8zMzI0NDQ4NjItMjczMjc3ZmItZmRiOC00NzhkLWFjMTQtOGY1NTAyZTY5ZWE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVk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