Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #4

Open
wants to merge 107 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 79 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
0600a94
Update README.md
Blacksujit Nov 25, 2024
77ef6ec
Update README.md
Blacksujit Nov 29, 2024
633584e
Update README.md
Blacksujit Nov 30, 2024
e2804ec
Update README.md
Blacksujit Nov 30, 2024
9380808
Added the api keys
Blacksujit Dec 17, 2024
449aa8d
Add .env to .gitignore
Blacksujit Dec 17, 2024
3fd575f
Add .env to .gitignore
Blacksujit Dec 17, 2024
a9e0c5c
Remove .env file from tracking
Blacksujit Dec 17, 2024
039c229
added the other files
Blacksujit Dec 17, 2024
84005eb
Kaggle Notebook | text-to-video.ipynb | Version 1
Blacksujit Dec 17, 2024
3b667a7
Rename text_to_video_new_approach_genai to text_to_video_new_approach…
Blacksujit Dec 17, 2024
e1d37f3
Kaggle Notebook | text-to-video.ipynb | Version 1
Blacksujit Dec 17, 2024
8e4ff3d
added the files to the generated_images folder
Blacksujit Dec 17, 2024
a749016
Added the files in downloads folder
Blacksujit Dec 17, 2024
0455654
dataviz ai name updated
Blacksujit Dec 18, 2024
17ac91b
Update README.md
Blacksujit Dec 18, 2024
3450631
Update README.md
Blacksujit Dec 18, 2024
047fbb4
Rename text_to_video_new_approach_genai to second_text_to_video_new_a…
Blacksujit Dec 18, 2024
cf4508b
Update README.md
Blacksujit Dec 18, 2024
3904fc3
Update README.md
Blacksujit Dec 20, 2024
faeeb2c
Update README.md
Blacksujit Dec 20, 2024
fc9b328
updates the things
Blacksujit Dec 20, 2024
5ba8f22
Update README.md
Blacksujit Dec 20, 2024
a8c7631
New features added in the file
Blacksujit Dec 23, 2024
48a0045
New features added in the file
Blacksujit Dec 23, 2024
1e644b1
New features added in the file
Blacksujit Dec 23, 2024
7d58acb
updated the changes
Blacksujit Dec 23, 2024
3abf77c
New code bloacks added in the file ✅
Blacksujit Dec 23, 2024
62ee2a0
New code bloacks added in the file ✅
Blacksujit Dec 23, 2024
6d4df7e
New code bloacks added in the file ✅
Blacksujit Dec 23, 2024
7f7e4e2
All the bugs are fixed and code is working ✅
Blacksujit Dec 24, 2024
4fe5f29
Update README.md
Blacksujit Dec 24, 2024
a1c8d18
All the bugs in the routes and NLP pipeline are fixed and code is wo…
Blacksujit Dec 24, 2024
675a554
All the bugs in the routes and NLP pipeline are fixed and code is wo…
Blacksujit Dec 24, 2024
afdd13c
All the bugs in the routes and NLP pipeline are fixed and code is wo…
Blacksujit Dec 24, 2024
5c5d75b
All the bugs in the routes and NLP pipeline are fixed and code is wo…
Blacksujit Dec 24, 2024
1d71aea
All the bugs in the routes and NLP pipeline are fixed and code is wo…
Blacksujit Dec 24, 2024
b8919f7
All the bugs in the routes and NLP pipeline are fixed and code is wo…
Blacksujit Dec 24, 2024
1ee1fb4
Created using Colab
Blacksujit Dec 24, 2024
72865df
All the generated videos by MVP in generated_images File ✅
Blacksujit Dec 24, 2024
03a907f
All the generated videos by MVP in generated_images File ✅
Blacksujit Dec 24, 2024
b2449c8
Kaggle Notebook | new_in_detailed_code_for_text_to_infographics | Ver…
Blacksujit Dec 24, 2024
69e5cd6
Rename Final_production_model_Genai to Final_production_model_Genai.i…
Blacksujit Dec 24, 2024
dbc5cce
Kaggle Notebook | new_in_detailed_code_for_text_to_infographics | Ver…
Blacksujit Dec 24, 2024
f9b8ea1
Rename Final_production_model_Genai to Final_production_model_Genai_s…
Blacksujit Dec 24, 2024
1c7e40d
Kaggle Notebook | new_in_detailed_code_for_text_to_infographics | Ver…
Blacksujit Dec 25, 2024
9cf16da
Kaggle Notebook | new_in_detailed_code_for_text_to_infographics | Ver…
Blacksujit Dec 25, 2024
fa4d270
Kaggle Notebook | new_in_detailed_code_for_text_to_infographics | Ver…
Blacksujit Dec 25, 2024
68ac32b
Rename Final_production_model_Genai to Final_production_model_Genai_n…
Blacksujit Dec 25, 2024
8ed45e1
Added the new video generation notebook ✅
Blacksujit Dec 25, 2024
90985ee
Added the new second_utility code for video generation notebook ✅
Blacksujit Dec 25, 2024
cdacd0b
Kaggle Notebook | new_in_detailed_code_for_text_to_infographics | Ver…
Blacksujit Dec 25, 2024
eed0cb0
added the resolutions and previous code to the codebase ✅
Blacksujit Dec 25, 2024
52fd696
added the resolutions and previous code to the codebase ✅
Blacksujit Dec 25, 2024
7465780
added the todays checlist code final block ✅
Blacksujit Dec 25, 2024
d30ee7a
added the todays checklist code final block ✅
Blacksujit Dec 25, 2024
29391c1
added the todays checklist code final block ✅
Blacksujit Dec 25, 2024
8e9da78
added the todays checklist code final block ✅
Blacksujit Dec 25, 2024
14706d5
Resolvd all errors related to renering ✅
Blacksujit Dec 26, 2024
e157abb
Resolvd all errors related to renering ✅
Blacksujit Dec 26, 2024
97cc2a0
Errors are there in csv to video moddule will do tommorow ✅
Blacksujit Dec 26, 2024
47d0eed
Errors are there in csv to video moddule will do tommorow ✅
Blacksujit Dec 26, 2024
56a2abc
Errors are there in csv to video moddule will do tommorow ✅
Blacksujit Dec 26, 2024
a74841c
Errors are there in csv to video moddule will do tommorow ✅
Blacksujit Dec 26, 2024
d79bbc9
Errors are there in csv to video moddule will do tommorow ✅
Blacksujit Dec 26, 2024
c6b78a1
Errors are there in csv to video moddule will do tommorow ✅
Blacksujit Dec 26, 2024
7fe7e94
Errors are there in csv to video moddule will do tommorow ✅
Blacksujit Dec 26, 2024
a87e358
Merge pull request #1 from Blacksujit/master
Blacksujit Dec 26, 2024
01ded1e
work started new day code ✅
Blacksujit Dec 27, 2024
da050b8
work started new day code ✅
Blacksujit Dec 27, 2024
6544884
the lfs limit is reached w
Blacksujit Dec 27, 2024
22702af
work started new day code ✅
Blacksujit Dec 27, 2024
7947618
Remove large file from Git LFS
Blacksujit Dec 27, 2024
c337924
Remove .pkl files from Git LFS and update .gitattributes
Blacksujit Dec 27, 2024
1289e2f
Remove .pkl files from Git LFS and update .gitattributes
Blacksujit Dec 27, 2024
f6484e3
Remove .pkl files from Git LFS and update .gitattributes
Blacksujit Dec 27, 2024
a473912
Remove .pkl files from Git LFS and update .gitattributes
Blacksujit Dec 27, 2024
72d8136
All checks done code is working ✅
Blacksujit Dec 27, 2024
b067da1
All checks done code is working ✅
Blacksujit Dec 28, 2024
1249446
code date - 28 ✅
Blacksujit Dec 28, 2024
ec45588
Kaggle Notebook | csv_to_video | Version 1
Blacksujit Dec 28, 2024
bf6dbd3
Model in working condition
Blacksujit Dec 28, 2024
f27ebe6
Complete csv to video model✅✅
Blacksujit Dec 28, 2024
ea181b7
Added files to downloads folder day 29 dec✅✅
Blacksujit Dec 29, 2024
cd18f6b
integrating csv to video model some issues day 29
Blacksujit Dec 29, 2024
36c4464
integration succesfull little styling remin ✅✅
Blacksujit Dec 30, 2024
735a216
integration succesfull little date 31 ✅✅
Blacksujit Dec 30, 2024
9d8dd80
integration succesfull little date 31 dec ✅✅
Blacksujit Dec 30, 2024
2a2efe3
integration succesfully completed date 31 dec ✅✅
Blacksujit Dec 30, 2024
9c6abb3
integration succesfully completed date 31 dec ✅✅
Blacksujit Dec 30, 2024
aa5279a
custom model going on 4 dec ✅✅
Blacksujit Jan 3, 2025
d3ad332
Added the final Model of Project ✅✅
Blacksujit Jan 4, 2025
7c5b3b8
Rename multimodel_notebok_production_code to multimodel_notebok_produ…
Blacksujit Jan 4, 2025
68af624
Final integration Day ✅✅
Blacksujit Jan 4, 2025
b035ca8
Final integration Day code ✅✅
Blacksujit Jan 4, 2025
cbc390c
final integration working on 3 model ✅✅
Blacksujit Jan 4, 2025
b1a72af
final integration working on 3 model ✅✅
Blacksujit Jan 4, 2025
e364706
Added the Readme Updates ✅✅
Blacksujit Jan 5, 2025
6ffe7e9
working on integration part date 5 ✅✅
Blacksujit Jan 5, 2025
c7d7087
working on integration part date 5 ✅✅
Blacksujit Jan 5, 2025
607a6a3
working on integration part date 6 ✅✅
Blacksujit Jan 5, 2025
6cce800
working on integration part date 6 ✅✅
Blacksujit Jan 5, 2025
593f930
working on integration part date 6 ✅✅
Blacksujit Jan 5, 2025
8186c6a
Integration Completed Successfully now styling ✅✅
Blacksujit Jan 7, 2025
274c100
Final Integration Completed Successfully now styling ✅✅
Blacksujit Jan 7, 2025
08f3219
Final Integration Completed Successfully now styling ✅✅
Blacksujit Jan 7, 2025
b87d82a
working on styling✅✅
Blacksujit Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
env
env
pycache/.env
.env
/pycache/
/models/
.gitattributes
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/100x_enginners_hackathon_genai.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .vs/100x_enginners_hackathon_genai/v17/.wsuo
Binary file not shown.
12 changes: 12 additions & 0 deletions .vs/100x_enginners_hackathon_genai/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Version": 1,
"WorkspaceRootPath": "F:\\100x_enginners_hackathon_genai\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": []
}
]
}
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
6 changes: 6 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
1 change: 1 addition & 0 deletions Final_production_model_Genai.ipynb

Large diffs are not rendered by default.

1,870 changes: 1,870 additions & 0 deletions Final_production_model_Genai_not_in_use_model.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Final_production_model_Genai_second.ipynb

Large diffs are not rendered by default.

110 changes: 77 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,97 @@
# Project Overview
# Our Hackathon MVP:

This project is a Flask-based web application that allows users to generate animated infographic videos based on input text. The application leverages the Pexels API for video content and incorporates natural language processing (NLP) techniques to analyze and transform the input text into a suitable format for video generation.
## DataVizAI

# Features
**![images](https://github.com/user-attachments/assets/e26aee53-96a6-4271-a28d-646419758071)**

1. **Text-to-Video Conversion**: Users can input text, and the application will generate a video based on the content of the text.
2. **NLP Analysis**: The application performs sentiment analysis and semantic segmentation on the input text to better understand its context and meaning.
3. **Video Generation**: The application uses the Pexels API to search for videos that match the processed text and returns a selection of video URLs.
4. **Logging**: The application logs responses from the Pexels API and OpenAI (if integrated) for debugging and analytics purposes.

# Technical Details
# MVP Videos:

1. **Backend**: The application is built using Flask, a Python web framework.
2. **NLP Libraries**: The application utilizes the following NLP libraries:
* TextBlob for sentiment analysis
* Spacy for semantic segmentation
* NLTK for text preprocessing
*transformers
*huggingface
*langchain
3. **API Integration**: The application integrates with the Pexels API for video content.
4. **Frontend**: The application uses HTML, CSS, and JavaScript for the user interface.
**coming soon ....**

# Installation and Setup
## Project Overview:

1. Clone the repository: `git clone https://github.com/Blacksujit/100X-Enginnerres-Hackathon-Submission`
Dataviz AI is an AI powered web application that enables users to generate animated infographic videos based on input Data , text,files. This MVP leverages the Pexels API for video content and incorporates advanced natural language processing (NLP) techniques, including LangChain and stable diffusion techniques, to analyze and create visual impact

## Key Features:

1. **Text-to-Video Conversion**: Users can input text, and the application will generate a video based on the content of the text, making information more engaging and accessible.

2. **NLP Analysis**: The application performs sentiment analysis and semantic segmentation on the input text to better understand its context and meaning, ensuring that the generated video aligns with the user's intent.

3. **Video Generation**: The application uses the Pexels API to search for videos that match the processed text and returns a selection of video URLs, providing users with high-quality visual content.

4. **Logging**: The application logs responses from the Pexels API and OpenAI (if integrated) for debugging and analytics purposes, allowing for continuous improvement and monitoring of the application’s performance.


## Impact of the Product:

The Dataviz AI is an AI powered web application has the potential to significantly impact various sectors, including education, marketing, and content creation. By transforming textual information into engaging video content, it enhances the way information is consumed and understood. Here are some key impacts:

- **Enhanced Learning**: In educational settings, the ability to convert complex text into visual formats can aid in comprehension and retention, making learning more effective.

- **Marketing and Communication**: Businesses can leverage this tool to create promotional videos quickly, allowing for more dynamic and engaging marketing strategies that capture audience attention.

- **Accessibility**: By providing visual representations of textual information, the application can help make content more accessible to individuals with different learning styles or those who may struggle with reading.

- **Content Creation**: Content creators can streamline their workflow by generating videos from scripts or articles, saving time and resources while maintaining high-quality output.


## Technical Overview

1. **Frontend**: The application uses HTML, CSS, and JavaScript for the user interface, providing a seamless user experience.

2. **Backend**: The application is built using Flask, a Python web framework that allows for easy routing and handling of HTTP requests.

3. **NLP Libraries**: The application utilizes the following NLP libraries:
- **TextBlob** for sentiment analysis, enabling the application to gauge the emotional tone of the input text.
- **SpaCy** for semantic segmentation, which helps in understanding the structure and meaning of the text.
- **NLTK** for text preprocessing, ensuring that the input text is clean and ready for analysis.
- **Transformers** and **Hugging Face** for advanced NLP tasks.
- **LangChain** for managing and chaining together different language models and tasks.

4. **API Integration**: The application integrates with the Pexels API for video content, allowing users to access a vast library of stock videos.


## Installation and Setup

1. Clone the repository:
```bash
https://github.com/Blacksujit/100X-Engineers-GenAI-Hackathon-Submission.git
```

2. Install the required packages:
```bash
pip install -r requirements.txt
```

2. Install the required packages: `pip install -r requirements.txt`
3. Set up the environment variables:
* `OPENAI_API_KEY`: Your OpenAI API key (if using OpenAI integration)
* `PEXELS_API_KEY`: Your Pexels API key
4. Run the application: `python app.py`
- `OPENAI_API_KEY`: Your OpenAI API key (if using OpenAI integration).
- `PEXELS_API_KEY`: Your Pexels API key.
- `GROQ_API_KEY`: Your Groq API key.

# Usage
4. Run the application:
```bash
python app.py
```

1. Open a web browser and navigate to `http://localhost:2000`
## Usage

1. Open a web browser and navigate to `http://localhost:2000`.
2. Input text in the text box on the homepage and click the "Generate Video" button.
3. The application will redirect you to a page displaying the generated video URLs.

# Contributing

## Contributing

Contributions are welcome! If you'd like to contribute to this project, please follow these steps:

1. Fork the repository
2. Create a new branch for your feature or fix
3. Make your changes and commit them
4. Push your branch to your forked repository
5. Submit a pull request to the original repository
1. Fork the repository.
2. Create a new branch for your feature or fix.
3. Make your changes and commit them.
4. Push your branch to your forked repository.
5. Submit a pull request to the original repository.

# License
## License

This project is licensed under the MIT License.
Binary file removed __pycache__/main.cpython-311.pyc
Binary file not shown.
Binary file removed __pycache__/routes.cpython-311.pyc
Binary file not shown.
Binary file removed __pycache__/utils.cpython-311.pyc
Binary file not shown.
Binary file added animated_infographic.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added animated_infographic.mp4
Binary file not shown.
25 changes: 24 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
"""
This is the entry point for the application.
The script performs the following tasks:
1. Imports necessary modules and functions.
2. Creates an instance of the application using the `create_app` function.
3. Ensures that the directories 'uploads' and 'models' exist, creating them if necessary.
4. Runs the application in debug mode on port 200.
If an exception occurs during the execution, it is logged as an error.
Modules:
os: Provides a way of using operating system dependent functionality.
logging: Provides a way to configure and use loggers.
Functions:
create_app: A function imported from the app module to create an instance of the application.
Exceptions:
Any exception that occurs during the execution is caught and logged.
"""
from app import create_app
import os
import logging

app = create_app()

if __name__ == "__main__":
app.run(debug=True, port=200)
try:
os.makedirs("uploads", exist_ok=True)
os.makedirs("models", exist_ok=True)
app.run(debug=True, port=200)
except Exception as e:
logging.error(f"An error occurred: {e}")
53 changes: 53 additions & 0 deletions app/Preprocess_text_NLP.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# import pandas as pd
# import matplotlib.pyplot as plt
# import matplotlib.animation as animation
# import numpy as np
# import os
# import torch
# from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, AutoModelForTokenClassification
# import gtts # For text-to-speech audio generation
# # from langchain_community import LangChain # For implementing langchain and other NLP tasks



# def nlp_pipeline(text, data):
# # Use T5 for summarization
# summary_model = AutoModelForSeq2SeqLM.from_pretrained('t5-base')
# summary_tokenizer = AutoTokenizer.from_pretrained('t5-base')

# # Prepare input
# input_text = f"summarize: {text} {data}"
# inputs = summary_tokenizer.encode(input_text, return_tensors='pt', max_length=512, truncation=True)

# # Generate summary
# outputs = summary_model.generate(inputs, max_length=100)
# summary_text = summary_tokenizer.decode(outputs[0], skip_special_tokens=True)

# # Extract percentages and categories using simpler regex patterns
# import re
# percentages = [int(x.strip('%')) for x in re.findall(r'\d+%', text)]
# words = text.split()
# categories = []

# # Find words after "use" or "uses"
# for i, word in enumerate(words):
# if word.lower() in ['use', 'uses'] and i + 1 < len(words):
# categories.append(words[i + 1])

# if not percentages or not categories:
# percentages = [100]
# categories = ['Summary']

# # Generate audio
# tts = gtts.gTTS(summary_text, lang='en')
# tts.save('summary_audio.mp3')

# return {
# 'categories': categories,
# 'values': percentages,
# 'text': summary_text
# }



# Old NLP pipeline code not in use having some import issues
20 changes: 17 additions & 3 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
from flask import Flask
from flask_caching import Cache
from flask import url_for
from flask_cors import CORS
# done with the conflicts

import os
def create_app():
app = Flask(__name__, template_folder='../templates') # Specify the path to the templates folder

app = Flask(__name__, template_folder='../templates', static_folder='../static') # Specify the path to the templates and static folders
# Set cache directory and other caching parameters
# models_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'models')
CORS(app)
app.config['CACHE_TYPE'] = 'filesystem'
app.config['CACHE_DIR'] = 'D:\\cahc_models_folder' # Change this to your desired cache path
app.config['CACHE_DEFAULT_TIMEOUT'] = 300
# Initialize the cache
cache = Cache(app)
# Set the path for the models directory (outside the app directory)

with app.app_context():
from .routes import main
app.register_blueprint(main)

return app
Binary file modified app/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified app/__pycache__/routes.cpython-311.pyc
Binary file not shown.
Binary file added app/__pycache__/second_utility.cpython-311.pyc
Binary file not shown.
Binary file modified app/__pycache__/utils.cpython-311.pyc
Binary file not shown.
Loading