Spaces:
Sleeping
Sleeping
Merge pull request #4 from sandesh-bharadwaj/dev
Browse files- .github/ISSUE_TEMPLATE/bug-report---.md +22 -0
- .github/ISSUE_TEMPLATE/feature-request---.md +15 -0
- .gitignore +173 -0
- .streamlit/config.toml +5 -0
- Dockerfile +20 -0
- LICENSE +399 -0
- README.md +271 -1
- assets/VidTune-Logo-With-BG.png +0 -0
- assets/VidTune-Logo-Without-BG.png +0 -0
- assets/favicon.png +0 -0
- assets/homepage.png +0 -0
- engine/__init__.py +2 -0
- engine/audio_generator.py +148 -0
- engine/video_descriptor.py +161 -0
- environment.yml +252 -0
- id_cleaner.py +66 -0
- logger.py +7 -0
- main.py +343 -0
- requirements.txt +228 -0
.github/ISSUE_TEMPLATE/bug-report---.md
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
name: "Bug report \U0001F41E"
|
3 |
+
about: Create a bug report
|
4 |
+
labels: bug
|
5 |
+
|
6 |
+
---
|
7 |
+
|
8 |
+
## Describe the bug
|
9 |
+
A clear and concise description of what the bug is.
|
10 |
+
|
11 |
+
### Steps to reproduce
|
12 |
+
Steps to reproduce the behavior.
|
13 |
+
|
14 |
+
### Expected behavior
|
15 |
+
A clear and concise description of what you expected to happen.
|
16 |
+
|
17 |
+
### Environment
|
18 |
+
- OS: [e.g. Arch Linux]
|
19 |
+
- Other details that you think may affect.
|
20 |
+
|
21 |
+
### Additional context
|
22 |
+
Add any other context about the problem here.
|
.github/ISSUE_TEMPLATE/feature-request---.md
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
name: "Feature request \U0001F680"
|
3 |
+
about: Suggest an idea
|
4 |
+
labels: enhancement
|
5 |
+
|
6 |
+
---
|
7 |
+
|
8 |
+
## Summary
|
9 |
+
Brief explanation of the feature.
|
10 |
+
|
11 |
+
### Basic example
|
12 |
+
Include a basic example or links here.
|
13 |
+
|
14 |
+
### Motivation
|
15 |
+
Why are we doing this? What use cases does it support? What is the expected outcome?
|
.gitignore
ADDED
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# Byte-compiled / optimized / DLL files
|
3 |
+
__pycache__/
|
4 |
+
*.py[cod]
|
5 |
+
*$py.class
|
6 |
+
|
7 |
+
# C extensions
|
8 |
+
*.so
|
9 |
+
|
10 |
+
# Distribution / packaging
|
11 |
+
.Python
|
12 |
+
build/
|
13 |
+
develop-eggs/
|
14 |
+
dist/
|
15 |
+
downloads/
|
16 |
+
eggs/
|
17 |
+
.eggs/
|
18 |
+
lib/
|
19 |
+
lib64/
|
20 |
+
parts/
|
21 |
+
sdist/
|
22 |
+
var/
|
23 |
+
wheels/
|
24 |
+
share/python-wheels/
|
25 |
+
*.egg-info/
|
26 |
+
.installed.cfg
|
27 |
+
*.egg
|
28 |
+
MANIFEST
|
29 |
+
|
30 |
+
# PyInstaller
|
31 |
+
# Usually these files are written by a python script from a template
|
32 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
33 |
+
*.manifest
|
34 |
+
*.spec
|
35 |
+
|
36 |
+
# Installer logs
|
37 |
+
pip-log.txt
|
38 |
+
pip-delete-this-directory.txt
|
39 |
+
|
40 |
+
# Unit test / coverage reports
|
41 |
+
htmlcov/
|
42 |
+
.tox/
|
43 |
+
.nox/
|
44 |
+
.coverage
|
45 |
+
.coverage.*
|
46 |
+
.cache
|
47 |
+
nosetests.xml
|
48 |
+
coverage.xml
|
49 |
+
*.cover
|
50 |
+
*.py,cover
|
51 |
+
.hypothesis/
|
52 |
+
.pytest_cache/
|
53 |
+
cover/
|
54 |
+
|
55 |
+
# Translations
|
56 |
+
*.mo
|
57 |
+
*.pot
|
58 |
+
|
59 |
+
# Django stuff:
|
60 |
+
*.log
|
61 |
+
local_settings.py
|
62 |
+
db.sqlite3
|
63 |
+
db.sqlite3-journal
|
64 |
+
|
65 |
+
# Flask stuff:
|
66 |
+
instance/
|
67 |
+
.webassets-cache
|
68 |
+
|
69 |
+
# Scrapy stuff:
|
70 |
+
.scrapy
|
71 |
+
|
72 |
+
# Sphinx documentation
|
73 |
+
docs/_build/
|
74 |
+
|
75 |
+
# PyBuilder
|
76 |
+
.pybuilder/
|
77 |
+
target/
|
78 |
+
|
79 |
+
# Jupyter Notebook
|
80 |
+
.ipynb_checkpoints
|
81 |
+
|
82 |
+
# IPython
|
83 |
+
profile_default/
|
84 |
+
ipython_config.py
|
85 |
+
|
86 |
+
# pyenv
|
87 |
+
# For a library or package, you might want to ignore these files since the code is
|
88 |
+
# intended to run in multiple environments; otherwise, check them in:
|
89 |
+
# .python-version
|
90 |
+
|
91 |
+
# pipenv
|
92 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
93 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
94 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
95 |
+
# install all needed dependencies.
|
96 |
+
#Pipfile.lock
|
97 |
+
|
98 |
+
# poetry
|
99 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
100 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
101 |
+
# commonly ignored for libraries.
|
102 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
103 |
+
#poetry.lock
|
104 |
+
|
105 |
+
# pdm
|
106 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
107 |
+
#pdm.lock
|
108 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
109 |
+
# in version control.
|
110 |
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
111 |
+
.pdm.toml
|
112 |
+
.pdm-python
|
113 |
+
.pdm-build/
|
114 |
+
|
115 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
116 |
+
__pypackages__/
|
117 |
+
|
118 |
+
# Celery stuff
|
119 |
+
celerybeat-schedule
|
120 |
+
celerybeat.pid
|
121 |
+
|
122 |
+
# SageMath parsed files
|
123 |
+
*.sage.py
|
124 |
+
|
125 |
+
# Environments
|
126 |
+
.env
|
127 |
+
.venv
|
128 |
+
env/
|
129 |
+
venv/
|
130 |
+
ENV/
|
131 |
+
env.bak/
|
132 |
+
venv.bak/
|
133 |
+
|
134 |
+
# Spyder project settings
|
135 |
+
.spyderproject
|
136 |
+
.spyproject
|
137 |
+
|
138 |
+
# Rope project settings
|
139 |
+
.ropeproject
|
140 |
+
|
141 |
+
# mkdocs documentation
|
142 |
+
/site
|
143 |
+
|
144 |
+
# mypy
|
145 |
+
.mypy_cache/
|
146 |
+
.dmypy.json
|
147 |
+
dmypy.json
|
148 |
+
|
149 |
+
# Pyre type checker
|
150 |
+
.pyre/
|
151 |
+
|
152 |
+
# pytype static type analyzer
|
153 |
+
.pytype/
|
154 |
+
|
155 |
+
# Cython debug symbols
|
156 |
+
cython_debug/
|
157 |
+
|
158 |
+
# PyCharm
|
159 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
160 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
161 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
162 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
163 |
+
#.idea/
|
164 |
+
|
165 |
+
|
166 |
+
*.wav
|
167 |
+
*.mp3
|
168 |
+
*.mp4
|
169 |
+
|
170 |
+
creds.json
|
171 |
+
|
172 |
+
# Ignore the test file
|
173 |
+
test.py
|
.streamlit/config.toml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[browser]
|
2 |
+
gatherUsageStats = false
|
3 |
+
|
4 |
+
[theme]
|
5 |
+
base = "light"
|
Dockerfile
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use micromamba as the base image
|
2 |
+
FROM python:3.9.19
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /src
|
6 |
+
|
7 |
+
# Copy Requirements file
|
8 |
+
COPY requirements.txt /src
|
9 |
+
|
10 |
+
# Install the required packages
|
11 |
+
RUN pip install -r requirements.txt
|
12 |
+
|
13 |
+
# Expose port 8003 for Streamlit
|
14 |
+
EXPOSE 8003
|
15 |
+
|
16 |
+
# Copy the current directory contents into the container at /src
|
17 |
+
COPY . /src
|
18 |
+
|
19 |
+
# Run id_cleaner.py as a background process and then start Streamlit
|
20 |
+
CMD ["sh", "-c", "python id_cleaner.py & streamlit run main.py --server.port 8003"]
|
LICENSE
ADDED
@@ -0,0 +1,399 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Attribution-NonCommercial 4.0 International
|
2 |
+
|
3 |
+
=======================================================================
|
4 |
+
|
5 |
+
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
6 |
+
does not provide legal services or legal advice. Distribution of
|
7 |
+
Creative Commons public licenses does not create a lawyer-client or
|
8 |
+
other relationship. Creative Commons makes its licenses and related
|
9 |
+
information available on an "as-is" basis. Creative Commons gives no
|
10 |
+
warranties regarding its licenses, any material licensed under their
|
11 |
+
terms and conditions, or any related information. Creative Commons
|
12 |
+
disclaims all liability for damages resulting from their use to the
|
13 |
+
fullest extent possible.
|
14 |
+
|
15 |
+
Using Creative Commons Public Licenses
|
16 |
+
|
17 |
+
Creative Commons public licenses provide a standard set of terms and
|
18 |
+
conditions that creators and other rights holders may use to share
|
19 |
+
original works of authorship and other material subject to copyright
|
20 |
+
and certain other rights specified in the public license below. The
|
21 |
+
following considerations are for informational purposes only, are not
|
22 |
+
exhaustive, and do not form part of our licenses.
|
23 |
+
|
24 |
+
Considerations for licensors: Our public licenses are
|
25 |
+
intended for use by those authorized to give the public
|
26 |
+
permission to use material in ways otherwise restricted by
|
27 |
+
copyright and certain other rights. Our licenses are
|
28 |
+
irrevocable. Licensors should read and understand the terms
|
29 |
+
and conditions of the license they choose before applying it.
|
30 |
+
Licensors should also secure all rights necessary before
|
31 |
+
applying our licenses so that the public can reuse the
|
32 |
+
material as expected. Licensors should clearly mark any
|
33 |
+
material not subject to the license. This includes other CC-
|
34 |
+
licensed material, or material used under an exception or
|
35 |
+
limitation to copyright. More considerations for licensors:
|
36 |
+
wiki.creativecommons.org/Considerations_for_licensors
|
37 |
+
|
38 |
+
Considerations for the public: By using one of our public
|
39 |
+
licenses, a licensor grants the public permission to use the
|
40 |
+
licensed material under specified terms and conditions. If
|
41 |
+
the licensor's permission is not necessary for any reason--for
|
42 |
+
example, because of any applicable exception or limitation to
|
43 |
+
copyright--then that use is not regulated by the license. Our
|
44 |
+
licenses grant only permissions under copyright and certain
|
45 |
+
other rights that a licensor has authority to grant. Use of
|
46 |
+
the licensed material may still be restricted for other
|
47 |
+
reasons, including because others have copyright or other
|
48 |
+
rights in the material. A licensor may make special requests,
|
49 |
+
such as asking that all changes be marked or described.
|
50 |
+
Although not required by our licenses, you are encouraged to
|
51 |
+
respect those requests where reasonable. More_considerations
|
52 |
+
for the public:
|
53 |
+
wiki.creativecommons.org/Considerations_for_licensees
|
54 |
+
|
55 |
+
=======================================================================
|
56 |
+
|
57 |
+
Creative Commons Attribution-NonCommercial 4.0 International Public
|
58 |
+
License
|
59 |
+
|
60 |
+
By exercising the Licensed Rights (defined below), You accept and agree
|
61 |
+
to be bound by the terms and conditions of this Creative Commons
|
62 |
+
Attribution-NonCommercial 4.0 International Public License ("Public
|
63 |
+
License"). To the extent this Public License may be interpreted as a
|
64 |
+
contract, You are granted the Licensed Rights in consideration of Your
|
65 |
+
acceptance of these terms and conditions, and the Licensor grants You
|
66 |
+
such rights in consideration of benefits the Licensor receives from
|
67 |
+
making the Licensed Material available under these terms and
|
68 |
+
conditions.
|
69 |
+
|
70 |
+
Section 1 -- Definitions.
|
71 |
+
|
72 |
+
a. Adapted Material means material subject to Copyright and Similar
|
73 |
+
Rights that is derived from or based upon the Licensed Material
|
74 |
+
and in which the Licensed Material is translated, altered,
|
75 |
+
arranged, transformed, or otherwise modified in a manner requiring
|
76 |
+
permission under the Copyright and Similar Rights held by the
|
77 |
+
Licensor. For purposes of this Public License, where the Licensed
|
78 |
+
Material is a musical work, performance, or sound recording,
|
79 |
+
Adapted Material is always produced where the Licensed Material is
|
80 |
+
synched in timed relation with a moving image.
|
81 |
+
|
82 |
+
b. Adapter's License means the license You apply to Your Copyright
|
83 |
+
and Similar Rights in Your contributions to Adapted Material in
|
84 |
+
accordance with the terms and conditions of this Public License.
|
85 |
+
|
86 |
+
c. Copyright and Similar Rights means copyright and/or similar rights
|
87 |
+
closely related to copyright including, without limitation,
|
88 |
+
performance, broadcast, sound recording, and Sui Generis Database
|
89 |
+
Rights, without regard to how the rights are labeled or
|
90 |
+
categorized. For purposes of this Public License, the rights
|
91 |
+
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
92 |
+
Rights.
|
93 |
+
d. Effective Technological Measures means those measures that, in the
|
94 |
+
absence of proper authority, may not be circumvented under laws
|
95 |
+
fulfilling obligations under Article 11 of the WIPO Copyright
|
96 |
+
Treaty adopted on December 20, 1996, and/or similar international
|
97 |
+
agreements.
|
98 |
+
|
99 |
+
e. Exceptions and Limitations means fair use, fair dealing, and/or
|
100 |
+
any other exception or limitation to Copyright and Similar Rights
|
101 |
+
that applies to Your use of the Licensed Material.
|
102 |
+
|
103 |
+
f. Licensed Material means the artistic or literary work, database,
|
104 |
+
or other material to which the Licensor applied this Public
|
105 |
+
License.
|
106 |
+
|
107 |
+
g. Licensed Rights means the rights granted to You subject to the
|
108 |
+
terms and conditions of this Public License, which are limited to
|
109 |
+
all Copyright and Similar Rights that apply to Your use of the
|
110 |
+
Licensed Material and that the Licensor has authority to license.
|
111 |
+
|
112 |
+
h. Licensor means the individual(s) or entity(ies) granting rights
|
113 |
+
under this Public License.
|
114 |
+
|
115 |
+
i. NonCommercial means not primarily intended for or directed towards
|
116 |
+
commercial advantage or monetary compensation. For purposes of
|
117 |
+
this Public License, the exchange of the Licensed Material for
|
118 |
+
other material subject to Copyright and Similar Rights by digital
|
119 |
+
file-sharing or similar means is NonCommercial provided there is
|
120 |
+
no payment of monetary compensation in connection with the
|
121 |
+
exchange.
|
122 |
+
|
123 |
+
j. Share means to provide material to the public by any means or
|
124 |
+
process that requires permission under the Licensed Rights, such
|
125 |
+
as reproduction, public display, public performance, distribution,
|
126 |
+
dissemination, communication, or importation, and to make material
|
127 |
+
available to the public including in ways that members of the
|
128 |
+
public may access the material from a place and at a time
|
129 |
+
individually chosen by them.
|
130 |
+
|
131 |
+
k. Sui Generis Database Rights means rights other than copyright
|
132 |
+
resulting from Directive 96/9/EC of the European Parliament and of
|
133 |
+
the Council of 11 March 1996 on the legal protection of databases,
|
134 |
+
as amended and/or succeeded, as well as other essentially
|
135 |
+
equivalent rights anywhere in the world.
|
136 |
+
|
137 |
+
l. You means the individual or entity exercising the Licensed Rights
|
138 |
+
under this Public License. Your has a corresponding meaning.
|
139 |
+
|
140 |
+
Section 2 -- Scope.
|
141 |
+
|
142 |
+
a. License grant.
|
143 |
+
|
144 |
+
1. Subject to the terms and conditions of this Public License,
|
145 |
+
the Licensor hereby grants You a worldwide, royalty-free,
|
146 |
+
non-sublicensable, non-exclusive, irrevocable license to
|
147 |
+
exercise the Licensed Rights in the Licensed Material to:
|
148 |
+
|
149 |
+
a. reproduce and Share the Licensed Material, in whole or
|
150 |
+
in part, for NonCommercial purposes only; and
|
151 |
+
|
152 |
+
b. produce, reproduce, and Share Adapted Material for
|
153 |
+
NonCommercial purposes only.
|
154 |
+
|
155 |
+
2. Exceptions and Limitations. For the avoidance of doubt, where
|
156 |
+
Exceptions and Limitations apply to Your use, this Public
|
157 |
+
License does not apply, and You do not need to comply with
|
158 |
+
its terms and conditions.
|
159 |
+
|
160 |
+
3. Term. The term of this Public License is specified in Section
|
161 |
+
6(a).
|
162 |
+
|
163 |
+
4. Media and formats; technical modifications allowed. The
|
164 |
+
Licensor authorizes You to exercise the Licensed Rights in
|
165 |
+
all media and formats whether now known or hereafter created,
|
166 |
+
and to make technical modifications necessary to do so. The
|
167 |
+
Licensor waives and/or agrees not to assert any right or
|
168 |
+
authority to forbid You from making technical modifications
|
169 |
+
necessary to exercise the Licensed Rights, including
|
170 |
+
technical modifications necessary to circumvent Effective
|
171 |
+
Technological Measures. For purposes of this Public License,
|
172 |
+
simply making modifications authorized by this Section 2(a)
|
173 |
+
(4) never produces Adapted Material.
|
174 |
+
|
175 |
+
5. Downstream recipients.
|
176 |
+
|
177 |
+
a. Offer from the Licensor -- Licensed Material. Every
|
178 |
+
recipient of the Licensed Material automatically
|
179 |
+
receives an offer from the Licensor to exercise the
|
180 |
+
Licensed Rights under the terms and conditions of this
|
181 |
+
Public License.
|
182 |
+
|
183 |
+
b. No downstream restrictions. You may not offer or impose
|
184 |
+
any additional or different terms or conditions on, or
|
185 |
+
apply any Effective Technological Measures to, the
|
186 |
+
Licensed Material if doing so restricts exercise of the
|
187 |
+
Licensed Rights by any recipient of the Licensed
|
188 |
+
Material.
|
189 |
+
|
190 |
+
6. No endorsement. Nothing in this Public License constitutes or
|
191 |
+
may be construed as permission to assert or imply that You
|
192 |
+
are, or that Your use of the Licensed Material is, connected
|
193 |
+
with, or sponsored, endorsed, or granted official status by,
|
194 |
+
the Licensor or others designated to receive attribution as
|
195 |
+
provided in Section 3(a)(1)(A)(i).
|
196 |
+
|
197 |
+
b. Other rights.
|
198 |
+
|
199 |
+
1. Moral rights, such as the right of integrity, are not
|
200 |
+
licensed under this Public License, nor are publicity,
|
201 |
+
privacy, and/or other similar personality rights; however, to
|
202 |
+
the extent possible, the Licensor waives and/or agrees not to
|
203 |
+
assert any such rights held by the Licensor to the limited
|
204 |
+
extent necessary to allow You to exercise the Licensed
|
205 |
+
Rights, but not otherwise.
|
206 |
+
|
207 |
+
2. Patent and trademark rights are not licensed under this
|
208 |
+
Public License.
|
209 |
+
|
210 |
+
3. To the extent possible, the Licensor waives any right to
|
211 |
+
collect royalties from You for the exercise of the Licensed
|
212 |
+
Rights, whether directly or through a collecting society
|
213 |
+
under any voluntary or waivable statutory or compulsory
|
214 |
+
licensing scheme. In all other cases the Licensor expressly
|
215 |
+
reserves any right to collect such royalties, including when
|
216 |
+
the Licensed Material is used other than for NonCommercial
|
217 |
+
purposes.
|
218 |
+
|
219 |
+
Section 3 -- License Conditions.
|
220 |
+
|
221 |
+
Your exercise of the Licensed Rights is expressly made subject to the
|
222 |
+
following conditions.
|
223 |
+
|
224 |
+
a. Attribution.
|
225 |
+
|
226 |
+
1. If You Share the Licensed Material (including in modified
|
227 |
+
form), You must:
|
228 |
+
|
229 |
+
a. retain the following if it is supplied by the Licensor
|
230 |
+
with the Licensed Material:
|
231 |
+
|
232 |
+
i. identification of the creator(s) of the Licensed
|
233 |
+
Material and any others designated to receive
|
234 |
+
attribution, in any reasonable manner requested by
|
235 |
+
the Licensor (including by pseudonym if
|
236 |
+
designated);
|
237 |
+
|
238 |
+
ii. a copyright notice;
|
239 |
+
|
240 |
+
iii. a notice that refers to this Public License;
|
241 |
+
|
242 |
+
iv. a notice that refers to the disclaimer of
|
243 |
+
warranties;
|
244 |
+
|
245 |
+
v. a URI or hyperlink to the Licensed Material to the
|
246 |
+
extent reasonably practicable;
|
247 |
+
|
248 |
+
b. indicate if You modified the Licensed Material and
|
249 |
+
retain an indication of any previous modifications; and
|
250 |
+
|
251 |
+
c. indicate the Licensed Material is licensed under this
|
252 |
+
Public License, and include the text of, or the URI or
|
253 |
+
hyperlink to, this Public License.
|
254 |
+
|
255 |
+
2. You may satisfy the conditions in Section 3(a)(1) in any
|
256 |
+
reasonable manner based on the medium, means, and context in
|
257 |
+
which You Share the Licensed Material. For example, it may be
|
258 |
+
reasonable to satisfy the conditions by providing a URI or
|
259 |
+
hyperlink to a resource that includes the required
|
260 |
+
information.
|
261 |
+
|
262 |
+
3. If requested by the Licensor, You must remove any of the
|
263 |
+
information required by Section 3(a)(1)(A) to the extent
|
264 |
+
reasonably practicable.
|
265 |
+
|
266 |
+
4. If You Share Adapted Material You produce, the Adapter's
|
267 |
+
License You apply must not prevent recipients of the Adapted
|
268 |
+
Material from complying with this Public License.
|
269 |
+
|
270 |
+
Section 4 -- Sui Generis Database Rights.
|
271 |
+
|
272 |
+
Where the Licensed Rights include Sui Generis Database Rights that
|
273 |
+
apply to Your use of the Licensed Material:
|
274 |
+
|
275 |
+
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
276 |
+
to extract, reuse, reproduce, and Share all or a substantial
|
277 |
+
portion of the contents of the database for NonCommercial purposes
|
278 |
+
only;
|
279 |
+
|
280 |
+
b. if You include all or a substantial portion of the database
|
281 |
+
contents in a database in which You have Sui Generis Database
|
282 |
+
Rights, then the database in which You have Sui Generis Database
|
283 |
+
Rights (but not its individual contents) is Adapted Material; and
|
284 |
+
|
285 |
+
c. You must comply with the conditions in Section 3(a) if You Share
|
286 |
+
all or a substantial portion of the contents of the database.
|
287 |
+
|
288 |
+
For the avoidance of doubt, this Section 4 supplements and does not
|
289 |
+
replace Your obligations under this Public License where the Licensed
|
290 |
+
Rights include other Copyright and Similar Rights.
|
291 |
+
|
292 |
+
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
293 |
+
|
294 |
+
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
295 |
+
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
296 |
+
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
297 |
+
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
298 |
+
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
299 |
+
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
300 |
+
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
301 |
+
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
302 |
+
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
303 |
+
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
304 |
+
|
305 |
+
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
306 |
+
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
307 |
+
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
308 |
+
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
309 |
+
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
310 |
+
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
311 |
+
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
312 |
+
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
313 |
+
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
314 |
+
|
315 |
+
c. The disclaimer of warranties and limitation of liability provided
|
316 |
+
above shall be interpreted in a manner that, to the extent
|
317 |
+
possible, most closely approximates an absolute disclaimer and
|
318 |
+
waiver of all liability.
|
319 |
+
|
320 |
+
Section 6 -- Term and Termination.
|
321 |
+
|
322 |
+
a. This Public License applies for the term of the Copyright and
|
323 |
+
Similar Rights licensed here. However, if You fail to comply with
|
324 |
+
this Public License, then Your rights under this Public License
|
325 |
+
terminate automatically.
|
326 |
+
|
327 |
+
b. Where Your right to use the Licensed Material has terminated under
|
328 |
+
Section 6(a), it reinstates:
|
329 |
+
|
330 |
+
1. automatically as of the date the violation is cured, provided
|
331 |
+
it is cured within 30 days of Your discovery of the
|
332 |
+
violation; or
|
333 |
+
|
334 |
+
2. upon express reinstatement by the Licensor.
|
335 |
+
|
336 |
+
For the avoidance of doubt, this Section 6(b) does not affect any
|
337 |
+
right the Licensor may have to seek remedies for Your violations
|
338 |
+
of this Public License.
|
339 |
+
|
340 |
+
c. For the avoidance of doubt, the Licensor may also offer the
|
341 |
+
Licensed Material under separate terms or conditions or stop
|
342 |
+
distributing the Licensed Material at any time; however, doing so
|
343 |
+
will not terminate this Public License.
|
344 |
+
|
345 |
+
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
346 |
+
License.
|
347 |
+
|
348 |
+
Section 7 -- Other Terms and Conditions.
|
349 |
+
|
350 |
+
a. The Licensor shall not be bound by any additional or different
|
351 |
+
terms or conditions communicated by You unless expressly agreed.
|
352 |
+
|
353 |
+
b. Any arrangements, understandings, or agreements regarding the
|
354 |
+
Licensed Material not stated herein are separate from and
|
355 |
+
independent of the terms and conditions of this Public License.
|
356 |
+
|
357 |
+
Section 8 -- Interpretation.
|
358 |
+
|
359 |
+
a. For the avoidance of doubt, this Public License does not, and
|
360 |
+
shall not be interpreted to, reduce, limit, restrict, or impose
|
361 |
+
conditions on any use of the Licensed Material that could lawfully
|
362 |
+
be made without permission under this Public License.
|
363 |
+
|
364 |
+
b. To the extent possible, if any provision of this Public License is
|
365 |
+
deemed unenforceable, it shall be automatically reformed to the
|
366 |
+
minimum extent necessary to make it enforceable. If the provision
|
367 |
+
cannot be reformed, it shall be severed from this Public License
|
368 |
+
without affecting the enforceability of the remaining terms and
|
369 |
+
conditions.
|
370 |
+
|
371 |
+
c. No term or condition of this Public License will be waived and no
|
372 |
+
failure to comply consented to unless expressly agreed to by the
|
373 |
+
Licensor.
|
374 |
+
|
375 |
+
d. Nothing in this Public License constitutes or may be interpreted
|
376 |
+
as a limitation upon, or waiver of, any privileges and immunities
|
377 |
+
that apply to the Licensor or You, including from the legal
|
378 |
+
processes of any jurisdiction or authority.
|
379 |
+
|
380 |
+
=======================================================================
|
381 |
+
|
382 |
+
Creative Commons is not a party to its public
|
383 |
+
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
384 |
+
its public licenses to material it publishes and in those instances
|
385 |
+
will be considered the “Licensor.” The text of the Creative Commons
|
386 |
+
public licenses is dedicated to the public domain under the CC0 Public
|
387 |
+
Domain Dedication. Except for the limited purpose of indicating that
|
388 |
+
material is shared under a Creative Commons public license or as
|
389 |
+
otherwise permitted by the Creative Commons policies published at
|
390 |
+
creativecommons.org/policies, Creative Commons does not authorize the
|
391 |
+
use of the trademark "Creative Commons" or any other trademark or logo
|
392 |
+
of Creative Commons without its prior written consent including,
|
393 |
+
without limitation, in connection with any unauthorized modifications
|
394 |
+
to any of its public licenses or any other arrangements,
|
395 |
+
understandings, or agreements concerning use of licensed material. For
|
396 |
+
the avoidance of doubt, this paragraph does not form part of the
|
397 |
+
public licenses.
|
398 |
+
|
399 |
+
Creative Commons may be contacted at creativecommons.org.
|
README.md
CHANGED
@@ -1 +1,271 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->
|
2 |
+
<a id="readme-top"></a>
|
3 |
+
<!--
|
4 |
+
*** Thanks for checking out the Best-README-Template. If you have a suggestion
|
5 |
+
*** that would make this better, please fork the repo and create a pull request
|
6 |
+
*** or simply open an issue with the tag "enhancement".
|
7 |
+
*** Don't forget to give the project a star!
|
8 |
+
*** Thanks again! Now go create something AMAZING! :D
|
9 |
+
-->
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
<!-- PROJECT SHIELDS -->
|
14 |
+
<!--
|
15 |
+
*** I'm using markdown "reference style" links for readability.
|
16 |
+
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
|
17 |
+
*** See the bottom of this document for the declaration of the reference variables
|
18 |
+
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
|
19 |
+
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
|
20 |
+
-->
|
21 |
+
[![Contributors][contributors-shield]][contributors-url]
|
22 |
+
[![Forks][forks-shield]][forks-url]
|
23 |
+
[![Stargazers][stars-shield]][stars-url]
|
24 |
+
[![Issues][issues-shield]][issues-url]
|
25 |
+
[![AGPL License][license-shield]][license-url]
|
26 |
+
[![Sandesh-LinkedIn][sandesh-linkedin-shield]][sandesh-linkedin-url]
|
27 |
+
[![Animikh-LinkedIn][animikh-linkedin-shield]][animikh-linkedin-url]
|
28 |
+
|
29 |
+
|
30 |
+
|
31 |
+
<!-- PROJECT LOGO -->
|
32 |
+
<br />
|
33 |
+
<div align="center">
|
34 |
+
<a href="https://github.com/sandesh-bharadwaj/VidTune">
|
35 |
+
<img src="assets/VidTune-Logo-Without-BG.png" alt="Logo" width="80" height="80">
|
36 |
+
</a>
|
37 |
+
|
38 |
+
<h3 align="center">VidTune</h3>
|
39 |
+
|
40 |
+
<p align="center">
|
41 |
+
Tailored soundtracks for your videos
|
42 |
+
<br />
|
43 |
+
<br />
|
44 |
+
<a href="https://github.com/sandesh-bharadwaj/VidTune/issues/new?labels=bug&template=bug-report---.md">Report Bug</a>
|
45 |
+
·
|
46 |
+
<a href="https://github.com/sandesh-bharadwaj/VidTune/issues/new?labels=enhancement&template=feature-request---.md">Request Feature</a>
|
47 |
+
</p>
|
48 |
+
</div>
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
+
<!-- TABLE OF CONTENTS -->
|
53 |
+
<details>
|
54 |
+
<summary>Table of Contents</summary>
|
55 |
+
<ol>
|
56 |
+
<li>
|
57 |
+
<a href="#about-the-project">About The Project</a>
|
58 |
+
<ul>
|
59 |
+
<li><a href="#built-with">Built With</a></li>
|
60 |
+
</ul>
|
61 |
+
</li>
|
62 |
+
<li>
|
63 |
+
<a href="#hardware-requirements">Hardware Requirements</a>
|
64 |
+
<ul>
|
65 |
+
<li><a href="#hardwarre-used-for-development-and-testing">Hardware used for Development and Testing</a></li>
|
66 |
+
</ul>
|
67 |
+
</li>
|
68 |
+
<li><a href="#see-vidtune-in-action">See VidTune in action!</a></li>
|
69 |
+
<li><a href="#roadmap">Roadmap</a></li>
|
70 |
+
<li><a href="#contributing">Contributing</a></li>
|
71 |
+
<li><a href="#license">License</a></li>
|
72 |
+
<li><a href="#contact">Contact</a></li>
|
73 |
+
<li><a href="#acknowledgments">Acknowledgments</a></li>
|
74 |
+
</ol>
|
75 |
+
</details>
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
<!-- ABOUT THE PROJECT -->
|
80 |
+
## About The Project
|
81 |
+
|
82 |
+
![startup_screen]
|
83 |
+
|
84 |
+
**VidTune** is a generative AI application designed to create custom music tailored to your video content. By leveraging advanced AI models for video analysis and music creation, **VidTune** provides an intuitive and seamless experience for generating and integrating music into your videos.
|
85 |
+
|
86 |
+
**VidTune** employs two state-of-the-art models for video understanding and music generation:
|
87 |
+
1. [**Google Gemini**](https://ai.google.dev/gemini-api) - Google's largest and most capable multimodal AI model.
|
88 |
+
2. [**MusicGen**](https://huggingface.co/facebook/musicgen-large) - Meta's text-to-music model, capable of generating high-quality music conditioned on text or audio prompts.
|
89 |
+
|
90 |
+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
### Built With
|
95 |
+
[![Transformers][Transformers-shield]][Transformers-url]
|
96 |
+
[![Google Gemini][Google-Gemini-shield]][Google-Gemini-url]
|
97 |
+
[![AudioCraft][AudioCraft-shield]][AudioCraft-url]
|
98 |
+
[![MusicGen][MusicGen-shield]][MusicGen-url]
|
99 |
+
[![Streamlit][Streamlit-shield]][Streamlit-url]
|
100 |
+
<!-- * [![Next][Next.js]][Next-url]
|
101 |
+
* [![React][React.js]][React-url]
|
102 |
+
* [![Vue][Vue.js]][Vue-url]
|
103 |
+
* [![Angular][Angular.io]][Angular-url]
|
104 |
+
* [![Svelte][Svelte.dev]][Svelte-url]
|
105 |
+
* [![Laravel][Laravel.com]][Laravel-url]
|
106 |
+
* [![Bootstrap][Bootstrap.com]][Bootstrap-url]
|
107 |
+
* [![JQuery][JQuery.com]][JQuery-url] -->
|
108 |
+
|
109 |
+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
110 |
+
|
111 |
+
|
112 |
+
## Hardware Requirements
|
113 |
+
|
114 |
+
### Hardware used for Development and Testing
|
115 |
+
|
116 |
+
- **CPU:** AMD Ryzen 7 3700X - 8 Cores 16 Threads
|
117 |
+
- **GPU:** Nvidia GeForce RTX 4060 Ti 16 GB
|
118 |
+
- **RAM:** 64 GB DDR4 @ 3200 MHz
|
119 |
+
- **OS:** Linux (WSL | Ubuntu 22.40)
|
120 |
+
|
121 |
+
The above is just used for development and by no means is necessary to run this application. The Minimum Hardware Requirements are given in the next section
|
122 |
+
|
123 |
+
While VidTune is supported on CPU-only machines, we recommend using a GPU with minimum 16GB of memory for faster results.
|
124 |
+
|
125 |
+
|
126 |
+
## See VidTune in action!
|
127 |
+
[](https://youtu.be/knbQjWZtL3Y)
|
128 |
+
|
129 |
+
## Running VidTune
|
130 |
+
First, clone the repository:
|
131 |
+
```sh
|
132 |
+
git clone https://github.com/sandesh-bharadwaj/VidTune.git
|
133 |
+
cd VidTune
|
134 |
+
```
|
135 |
+
### Using conda
|
136 |
+
If you're using conda as your virtual environment manager, do the following:
|
137 |
+
```
|
138 |
+
conda env create -f environment.yml
|
139 |
+
conda activate vidtune
|
140 |
+
|
141 |
+
streamlit run main.py
|
142 |
+
```
|
143 |
+
|
144 |
+
### Using python / pip
|
145 |
+
```
|
146 |
+
pip install -r requirements.txt
|
147 |
+
streamlit run main.py
|
148 |
+
```
|
149 |
+
|
150 |
+
### Using Docker
|
151 |
+
- [Docker](https://docs.docker.com/engine/install/)
|
152 |
+
- [Nvidia Docker](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installing-with-apt)
|
153 |
+
|
154 |
+
Docker Hub Image: https://hub.docker.com/r/animikhaich/vidtune
|
155 |
+
|
156 |
+
```
|
157 |
+
docker run --rm -it --gpus all -p 8003:8003 animikhaich/vidtune
|
158 |
+
```
|
159 |
+
|
160 |
+
|
161 |
+
|
162 |
+
<!-- ROADMAP -->
|
163 |
+
## Roadmap
|
164 |
+
- [x] Customized Prompt for Gemini Prompting
|
165 |
+
- [x] Flutter version of app for proof-of-concept
|
166 |
+
- [x] MusicGen integration
|
167 |
+
- [x] Audio Mixing
|
168 |
+
- [x] Streamlit app
|
169 |
+
- [x] Docker image
|
170 |
+
- [ ] OpenVINO-optimized versions of MusicGen for CPU-Only use.
|
171 |
+
- [ ] Support for music generation duration > 30 seconds.
|
172 |
+
- [ ] Add more settings for controlling generation.
|
173 |
+
- [ ] Option to edit music prompts before music generation.
|
174 |
+
|
175 |
+
|
176 |
+
See the [open issues](https://github.com/sandesh-bharadwaj/VIdTune/issues) for a full list of proposed features (and known issues).
|
177 |
+
|
178 |
+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
179 |
+
|
180 |
+
|
181 |
+
|
182 |
+
<!-- CONTRIBUTING -->
|
183 |
+
## Contributing
|
184 |
+
|
185 |
+
If you have a suggestion that would improve this, please **open an issue** with the tag *"enhancement"*.You can also **fork the repo** and create a pull request. Your feedback is greatly appreciated!
|
186 |
+
Don't forget to give the project a star! Thanks again!
|
187 |
+
|
188 |
+
1. Fork the Project
|
189 |
+
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
|
190 |
+
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
|
191 |
+
4. Push to the Branch (`git push origin feature/AmazingFeature`)
|
192 |
+
5. Open a Pull Request
|
193 |
+
|
194 |
+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
195 |
+
|
196 |
+
|
197 |
+
|
198 |
+
<!-- LICENSE -->
|
199 |
+
## License
|
200 |
+
|
201 |
+
Distributed under the CC BY-NC 4.0 License. See [`LICENSE`](./LICENSE) for more information.
|
202 |
+
|
203 |
+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
204 |
+
|
205 |
+
|
206 |
+
|
207 |
+
<!-- CONTACT -->
|
208 |
+
## Contact
|
209 |
+
|
210 |
+
Sandesh Bharadwaj - [email protected]
|
211 |
+
|
212 |
+
Animikh Aich - [email protected]
|
213 |
+
|
214 |
+
Project Link: [https://github.com/sandesh-bharadwaj/VidTune](https://github.com/sandesh-bharadwaj/VidTune)
|
215 |
+
|
216 |
+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
217 |
+
|
218 |
+
|
219 |
+
|
220 |
+
<!-- ACKNOWLEDGMENTS -->
|
221 |
+
## Acknowledgments
|
222 |
+
|
223 |
+
* Google.
|
224 |
+
* Meta.
|
225 |
+
|
226 |
+
|
227 |
+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
228 |
+
|
229 |
+
|
230 |
+
|
231 |
+
<!-- MARKDOWN LINKS & IMAGES -->
|
232 |
+
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
233 |
+
[contributors-shield]: https://img.shields.io/github/contributors/sandesh-bharadwaj/VidTune.svg?style=for-the-badge
|
234 |
+
[contributors-url]: https://github.com/sandesh-bharadwaj/VidTune/graphs/contributors
|
235 |
+
[forks-shield]: https://img.shields.io/github/forks/sandesh-bharadwaj/VidTune.svg?style=for-the-badge
|
236 |
+
[forks-url]: https://github.com/sandesh-bharadwaj/VidTune/network/members
|
237 |
+
[stars-shield]: https://img.shields.io/github/stars/sandesh-bharadwaj/VidTune.svg?style=for-the-badge
|
238 |
+
[stars-url]: https://github.com/sandesh-bharadwaj/VidTune/stargazers
|
239 |
+
[issues-shield]: https://img.shields.io/github/issues/sandesh-bharadwaj/VidTune.svg?style=for-the-badge
|
240 |
+
[issues-url]: https://github.com/sandesh-bharadwaj/VidTune/issues
|
241 |
+
[license-shield]: https://img.shields.io/github/license/sandesh-bharadwaj/VidTune.svg?style=for-the-badge
|
242 |
+
[license-url]: https://github.com/sandesh-bharadwaj/VidTune/blob/main/LICENSE
|
243 |
+
[llama-3-shield]: https://img.shields.io/badge/License-Llama%203-purple.svg?style=for-the-badge
|
244 |
+
[llama-3-license]: https://github.com/sandesh-bharadwaj/VidTune/blob/main/LLAMA-3-LICENSE
|
245 |
+
[sandesh-linkedin-shield]: https://img.shields.io/badge/-Sandesh_Bharadwaj-black.svg?style=for-the-badge&logo=linkedin&colorB=555
|
246 |
+
[sandesh-linkedin-url]: https://linkedin.com/in/sandeshbharadwaj97
|
247 |
+
[animikh-linkedin-shield]: https://img.shields.io/badge/-Animikh_Aich-black.svg?style=for-the-badge&logo=linkedin&colorB=555
|
248 |
+
[animikh-linkedin-url]: https://linkedin.com/in/animikh-aich
|
249 |
+
[startup_screen]: assets/homepage.png
|
250 |
+
|
251 |
+
[Python-url]: https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54
|
252 |
+
[Langchain-shield]: https://img.shields.io/badge/LangChain-0.2.12-1C3C3C?style=for-the-badge&logo=langchain
|
253 |
+
[Langchain-url]: https://github.com/langchain-ai/langchain
|
254 |
+
[Transformers-shield]: https://img.shields.io/badge/Transformers-4.42.4-blue?style=for-the-badge
|
255 |
+
[Transformers-url]: https://github.com/huggingface/transformers
|
256 |
+
[Optimum-shield]: https://img.shields.io/badge/Optimum-1.21.2-blue?style=for-the-badge
|
257 |
+
[Optimum-url]: https://github.com/huggingface/optimum
|
258 |
+
[OpenVINO-shield]: https://img.shields.io/badge/OpenVINO-2024.3-purple?style=for-the-badge
|
259 |
+
[OpenVINO-url]: https://github.com/openvinotoolkit/openvino
|
260 |
+
[Chroma-shield]: https://img.shields.io/badge/Chroma-0.5.5-blue?style=for-the-badge
|
261 |
+
[Chroma-url]: https://github.com/chroma-core/chroma
|
262 |
+
|
263 |
+
[Google-Gemini-shield]: https://img.shields.io/badge/Google%20Gemini-886FBF?style=for-the-badge&logo=googlegemini&logoColor=fff
|
264 |
+
[Google-Gemini-url]: https://ai.google.dev/gemini-api
|
265 |
+
[Streamlit-shield]: https://img.shields.io/badge/-Streamlit-FF4B4B?style=for-the-badge&logo=streamlit&logoColor=white
|
266 |
+
[Streamlit-url]: https://streamlit.io/
|
267 |
+
|
268 |
+
[AudioCraft-shield]: https://img.shields.io/badge/-AudioCraft-blue?style=for-the-badge&logo=Meta
|
269 |
+
[AudioCraft-url]: https://audiocraft.metademolab.com/
|
270 |
+
[MusicGen-shield]:https://img.shields.io/badge/-MusicGen-blue?style=for-the-badge&logo=Meta
|
271 |
+
[MusicGen-url]: https://musicgen.com/
|
assets/VidTune-Logo-With-BG.png
ADDED
![]() |
assets/VidTune-Logo-Without-BG.png
ADDED
![]() |
assets/favicon.png
ADDED
![]() |
assets/homepage.png
ADDED
![]() |
engine/__init__.py
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
from .video_descriptor import DescribeVideo
|
2 |
+
from .audio_generator import GenerateAudio
|
engine/audio_generator.py
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import warnings
|
3 |
+
import traceback
|
4 |
+
|
5 |
+
warnings.simplefilter("ignore")
|
6 |
+
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
|
7 |
+
import io
|
8 |
+
import torch
|
9 |
+
import numpy as np
|
10 |
+
from audiocraft.models import musicgen
|
11 |
+
from scipy.io.wavfile import write as wav_write
|
12 |
+
|
13 |
+
try:
|
14 |
+
from logger import logging
|
15 |
+
except:
|
16 |
+
import logging
|
17 |
+
|
18 |
+
|
19 |
+
class GenerateAudio:
|
20 |
+
def __init__(self, model="musicgen-stereo-small"):
|
21 |
+
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
22 |
+
self.model_name = self.get_model_name(model)
|
23 |
+
self.model = self.get_model(self.model_name, self.device)
|
24 |
+
self.generated_audio = None
|
25 |
+
self.sampling_rate = None
|
26 |
+
|
27 |
+
@staticmethod
|
28 |
+
def get_model(model, device):
|
29 |
+
try:
|
30 |
+
model = musicgen.MusicGen.get_pretrained(model, device=device)
|
31 |
+
logging.info(f"Loaded model: {model}")
|
32 |
+
return model
|
33 |
+
except Exception as e:
|
34 |
+
logging.error(
|
35 |
+
f"Failed to load model: {e}, Traceback: {traceback.format_exc()}"
|
36 |
+
)
|
37 |
+
raise ValueError(f"Failed to load model: {e}")
|
38 |
+
return
|
39 |
+
|
40 |
+
@staticmethod
|
41 |
+
def get_model_name(model_name):
|
42 |
+
if model_name.startswith("facebook/"):
|
43 |
+
return model_name
|
44 |
+
return f"facebook/{model_name}"
|
45 |
+
|
46 |
+
@staticmethod
|
47 |
+
def duration_sanity_check(duration):
|
48 |
+
if duration < 1:
|
49 |
+
logging.warning(
|
50 |
+
"Duration is less than 1 second. Setting duration to 1 second."
|
51 |
+
)
|
52 |
+
return 1
|
53 |
+
elif duration > 30:
|
54 |
+
logging.warning(
|
55 |
+
"Duration is greater than 30 seconds. Setting duration to 30 seconds."
|
56 |
+
)
|
57 |
+
return 30
|
58 |
+
return duration
|
59 |
+
|
60 |
+
@staticmethod
|
61 |
+
def prompts_sanity_check(prompts):
|
62 |
+
if isinstance(prompts, str):
|
63 |
+
prompts = [prompts]
|
64 |
+
elif not isinstance(prompts, list):
|
65 |
+
raise ValueError("Prompts should be a string or a list of strings.")
|
66 |
+
else:
|
67 |
+
for prompt in prompts:
|
68 |
+
if not isinstance(prompt, str):
|
69 |
+
raise ValueError("Prompts should be a string or a list of strings.")
|
70 |
+
if len(prompts) > 8: # Too many prompts will cause OOM error
|
71 |
+
raise ValueError("Maximum number of prompts allowed is 8.")
|
72 |
+
return prompts
|
73 |
+
|
74 |
+
def generate_audio(self, prompts, duration=10):
|
75 |
+
duration = self.duration_sanity_check(duration)
|
76 |
+
prompts = self.prompts_sanity_check(prompts)
|
77 |
+
|
78 |
+
try:
|
79 |
+
self.sampling_rate = self.model.sample_rate
|
80 |
+
if duration <= 30:
|
81 |
+
self.model.set_generation_params(duration=duration)
|
82 |
+
result = self.model.generate(prompts, progress=False)
|
83 |
+
elif duration > 30:
|
84 |
+
self.model.set_generation_params(duration=30)
|
85 |
+
result = self.model.generate(prompts, progress=False)
|
86 |
+
self.model.set_generation_params(duration=duration)
|
87 |
+
result = self.model.generate_with_chroma(
|
88 |
+
prompts,
|
89 |
+
result,
|
90 |
+
melody_sample_rate=self.sampling_rate,
|
91 |
+
progress=False,
|
92 |
+
)
|
93 |
+
self.result = result.cpu().numpy().T
|
94 |
+
self.result = self.result.transpose((2, 0, 1))
|
95 |
+
|
96 |
+
logging.info(
|
97 |
+
f"Generated audio with shape: {self.result.shape}, sample rate: {self.sampling_rate} Hz"
|
98 |
+
)
|
99 |
+
return self.sampling_rate, self.result
|
100 |
+
except Exception as e:
|
101 |
+
logging.error(
|
102 |
+
f"Failed to generate audio: {e}, Traceback: {traceback.format_exc()}"
|
103 |
+
)
|
104 |
+
raise ValueError(f"Failed to generate audio: {e}")
|
105 |
+
|
106 |
+
def save_audio(self, audio_dir="generated_audio"):
|
107 |
+
if self.result is None:
|
108 |
+
raise ValueError("Audio is not generated yet.")
|
109 |
+
if self.sampling_rate is None:
|
110 |
+
raise ValueError("Sampling rate is not available.")
|
111 |
+
|
112 |
+
paths = []
|
113 |
+
os.makedirs(audio_dir, exist_ok=True)
|
114 |
+
for i, audio in enumerate(self.result):
|
115 |
+
path = os.path.join(audio_dir, f"audio_{i}.wav")
|
116 |
+
wav_write(path, self.sampling_rate, audio)
|
117 |
+
paths.append(path)
|
118 |
+
return paths
|
119 |
+
|
120 |
+
def get_audio_buffer(self):
|
121 |
+
if self.result is None:
|
122 |
+
raise ValueError("Audio is not generated yet.")
|
123 |
+
if self.sampling_rate is None:
|
124 |
+
raise ValueError("Sampling rate is not available.")
|
125 |
+
|
126 |
+
buffers = []
|
127 |
+
for audio in self.result:
|
128 |
+
buffer = io.BytesIO()
|
129 |
+
wav_write(buffer, self.sampling_rate, audio)
|
130 |
+
buffer.seek(0)
|
131 |
+
buffers.append(buffer)
|
132 |
+
return buffers
|
133 |
+
|
134 |
+
|
135 |
+
if __name__ == "__main__":
|
136 |
+
audio_gen = GenerateAudio()
|
137 |
+
sample_rate, result = audio_gen.generate_audio(
|
138 |
+
[
|
139 |
+
"A piano playing a jazz melody",
|
140 |
+
"A guitar playing a rock riff",
|
141 |
+
"A LoFi music for coding",
|
142 |
+
],
|
143 |
+
duration=10,
|
144 |
+
)
|
145 |
+
paths = audio_gen.save_audio()
|
146 |
+
print(f"Saved audio to: {paths}")
|
147 |
+
buffers = audio_gen.get_audio_buffer()
|
148 |
+
print(f"Audio buffers: {buffers}")
|
engine/video_descriptor.py
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from warnings import simplefilter
|
3 |
+
import traceback
|
4 |
+
|
5 |
+
simplefilter("ignore")
|
6 |
+
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
|
7 |
+
import json
|
8 |
+
import time
|
9 |
+
import google.generativeai as genai
|
10 |
+
|
11 |
+
try:
|
12 |
+
from logger import logging
|
13 |
+
except:
|
14 |
+
import logging
|
15 |
+
|
16 |
+
music_prompt_examples = """
|
17 |
+
'A dynamic blend of hip-hop and orchestral elements, with sweeping strings and brass, evoking the vibrant energy of the city',
|
18 |
+
'Smooth jazz, with a saxophone solo, piano chords, and snare full drums',
|
19 |
+
'90s rock song with electric guitar and heavy drums, nightcore, 140bpm',
|
20 |
+
'lofi melody loop, A minor, 110 bpm, jazzy chords evoking a feeling of curiosity, relaxing, vinyl recording',
|
21 |
+
'J-Pop, 140bpm, 320kbps, 48kHz',
|
22 |
+
'funk, disco, R&B, AOR, soft rock, and boogie',
|
23 |
+
'a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions bpm: 130'.
|
24 |
+
"""
|
25 |
+
|
26 |
+
json_schema = """
|
27 |
+
{"Content Description": "string", "Music Prompt": "string"}
|
28 |
+
"""
|
29 |
+
|
30 |
+
gemini_instructions = f"""
|
31 |
+
You are a music supervisor who analyzes the content and tone of images and videos to describe music that fits well with the mood, evokes emotions, and enhances the narrative of the visuals. Given an image or video, describe the scene and generate a prompt suitable for music generation models. Generate a music prompt based on the description, and use keywords if provided by the user:
|
32 |
+
|
33 |
+
{music_prompt_examples}
|
34 |
+
|
35 |
+
You must return your response using this JSON schema: {json_schema}
|
36 |
+
"""
|
37 |
+
|
38 |
+
|
39 |
+
class DescribeVideo:
|
40 |
+
def __init__(self, model="flash", google_api_key=None):
|
41 |
+
self.model = self.get_model_name(model)
|
42 |
+
__api_key = google_api_key # self.load_api_key()
|
43 |
+
self.is_safety_set = False
|
44 |
+
self.safety_settings = self.get_safety_settings()
|
45 |
+
|
46 |
+
genai.configure(api_key=__api_key)
|
47 |
+
self.mllm_model = genai.GenerativeModel(
|
48 |
+
self.model, system_instruction=gemini_instructions
|
49 |
+
)
|
50 |
+
|
51 |
+
logging.info(f"Initialized DescribeVideo with model: {self.model}")
|
52 |
+
|
53 |
+
def describe_video(self, video_path, genre, bpm, user_keywords):
|
54 |
+
video_file = genai.upload_file(video_path)
|
55 |
+
|
56 |
+
while video_file.state.name == "PROCESSING":
|
57 |
+
time.sleep(0.25)
|
58 |
+
video_file = genai.get_file(video_file.name)
|
59 |
+
|
60 |
+
if video_file.state.name == "FAILED":
|
61 |
+
logging.error(
|
62 |
+
f"Failed to upload video: {video_file.state.name}, Traceback: {traceback.format_exc()}"
|
63 |
+
)
|
64 |
+
raise ValueError(f"Failed to upload video: {video_file.state.name}")
|
65 |
+
|
66 |
+
additional_keywords = ", ".join(filter(None, [genre, user_keywords])) + (
|
67 |
+
f", {bpm} bpm" if bpm else ""
|
68 |
+
)
|
69 |
+
|
70 |
+
logging.info(f"Uploaded video: {video_path} and config: {additional_keywords}")
|
71 |
+
|
72 |
+
user_prompt = "Explain what is happening in this video."
|
73 |
+
|
74 |
+
if additional_keywords:
|
75 |
+
user_prompt += f" The following keywords are provided by the user for generating the music prompt: {additional_keywords}"
|
76 |
+
|
77 |
+
response = self.mllm_model.generate_content(
|
78 |
+
[video_file, user_prompt],
|
79 |
+
request_options={"timeout": 600},
|
80 |
+
safety_settings=self.safety_settings,
|
81 |
+
)
|
82 |
+
|
83 |
+
logging.info(f"Generated : {video_path} with response: {response.text}")
|
84 |
+
|
85 |
+
return json.loads(response.text.strip("```json\n"))
|
86 |
+
|
87 |
+
def __call__(self, video_path):
|
88 |
+
return self.describe_video(video_path)
|
89 |
+
|
90 |
+
def reset_safety_settings(self):
|
91 |
+
logging.info("Resetting safety settings")
|
92 |
+
self.is_safety_set = False
|
93 |
+
self.safety_settings = self.get_safety_settings()
|
94 |
+
|
95 |
+
def set_safety_settings(self, safety_settings):
|
96 |
+
self.safety_settings = safety_settings
|
97 |
+
# Sanity Checks
|
98 |
+
if not isinstance(safety_settings, dict):
|
99 |
+
raise ValueError("Safety settings must be a dictionary")
|
100 |
+
for harm_category, harm_block_threshold in safety_settings.items():
|
101 |
+
if harm_category not in genai.types.HarmCategory.__members__:
|
102 |
+
raise ValueError(f"Invalid harm category: {harm_category}")
|
103 |
+
if harm_block_threshold not in genai.types.HarmBlockThreshold.__members__:
|
104 |
+
raise ValueError(
|
105 |
+
f"Invalid harm block threshold: {harm_block_threshold}"
|
106 |
+
)
|
107 |
+
|
108 |
+
logging.info(f"Set safety settings: {safety_settings}")
|
109 |
+
self.safety_settings = safety_settings
|
110 |
+
self.is_safety_set = True
|
111 |
+
|
112 |
+
def get_safety_settings(self):
|
113 |
+
default_safety_settings = {
|
114 |
+
genai.types.HarmCategory.HARM_CATEGORY_HATE_SPEECH: genai.types.HarmBlockThreshold.BLOCK_NONE,
|
115 |
+
genai.types.HarmCategory.HARM_CATEGORY_HARASSMENT: genai.types.HarmBlockThreshold.BLOCK_NONE,
|
116 |
+
genai.types.HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: genai.types.HarmBlockThreshold.BLOCK_NONE,
|
117 |
+
genai.types.HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: genai.types.HarmBlockThreshold.BLOCK_NONE,
|
118 |
+
}
|
119 |
+
|
120 |
+
if self.is_safety_set:
|
121 |
+
return self.safety_settings
|
122 |
+
|
123 |
+
return default_safety_settings
|
124 |
+
|
125 |
+
@staticmethod
|
126 |
+
def load_api_key(path="./creds.json"):
|
127 |
+
with open(path) as f:
|
128 |
+
creds = json.load(f)
|
129 |
+
|
130 |
+
api_key = creds.get("google_api_key", None)
|
131 |
+
if api_key is None or not isinstance(api_key, str):
|
132 |
+
logging.error(
|
133 |
+
f"Google API key not found in {path}, Traceback: {traceback.format_exc()}"
|
134 |
+
)
|
135 |
+
raise ValueError(f"Gemini API key not found in {path}")
|
136 |
+
return api_key
|
137 |
+
|
138 |
+
@staticmethod
|
139 |
+
def get_model_name(model):
|
140 |
+
models = {
|
141 |
+
"flash": "models/gemini-1.5-flash-latest",
|
142 |
+
"pro": "models/gemini-1.5-pro-latest",
|
143 |
+
}
|
144 |
+
|
145 |
+
if model not in models:
|
146 |
+
logging.error(
|
147 |
+
f"Invalid model name '{model}'. Valid options are: {', '.join(models.keys())}, Traceback: {traceback.format_exc()}"
|
148 |
+
)
|
149 |
+
raise ValueError(
|
150 |
+
f"Invalid model name '{model}'. Valid options are: {', '.join(models.keys())}"
|
151 |
+
)
|
152 |
+
|
153 |
+
logging.info(f"Selected model: {models[model]}")
|
154 |
+
return models[model]
|
155 |
+
|
156 |
+
|
157 |
+
if __name__ == "__main__":
|
158 |
+
video_path = "videos/3A49B385FD4A8FE2E3AEEF43C140D9AF_video_dashinit.mp4"
|
159 |
+
dv = DescribeVideo(model="flash")
|
160 |
+
video_description = dv.describe_video(video_path)
|
161 |
+
print(video_description)
|
environment.yml
ADDED
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: vidtune
|
2 |
+
channels:
|
3 |
+
- defaults
|
4 |
+
dependencies:
|
5 |
+
- _libgcc_mutex=0.1
|
6 |
+
- _openmp_mutex=5.1
|
7 |
+
- ca-certificates=2024.3.11
|
8 |
+
- ld_impl_linux-64=2.38
|
9 |
+
- libffi=3.4.4
|
10 |
+
- libgcc-ng=11.2.0
|
11 |
+
- libgomp=11.2.0
|
12 |
+
- libstdcxx-ng=11.2.0
|
13 |
+
- ncurses=6.4
|
14 |
+
- openssl=3.0.14
|
15 |
+
- pip=24.0
|
16 |
+
- python=3.9.19
|
17 |
+
- readline=8.2
|
18 |
+
- setuptools=69.5.1
|
19 |
+
- sqlite=3.45.3
|
20 |
+
- tk=8.6.14
|
21 |
+
- wheel=0.43.0
|
22 |
+
- xz=5.4.6
|
23 |
+
- zlib=1.2.13
|
24 |
+
- pip:
|
25 |
+
- aiofiles==23.2.1
|
26 |
+
- altair==5.3.0
|
27 |
+
- annotated-types==0.7.0
|
28 |
+
- antlr4-python3-runtime==4.9.3
|
29 |
+
- anyio==4.4.0
|
30 |
+
- asttokens==2.4.1
|
31 |
+
- attrs==23.2.0
|
32 |
+
- audiocraft==1.3.0
|
33 |
+
- audioread==3.0.1
|
34 |
+
- av==11.0.0
|
35 |
+
- backcall==0.2.0
|
36 |
+
- beautifulsoup4==4.12.3
|
37 |
+
- bleach==6.1.0
|
38 |
+
- blinker==1.8.2
|
39 |
+
- blis==0.7.11
|
40 |
+
- cachetools==5.3.3
|
41 |
+
- catalogue==2.0.10
|
42 |
+
- certifi==2024.7.4
|
43 |
+
- cffi==1.16.0
|
44 |
+
- charset-normalizer==3.3.2
|
45 |
+
- click==8.1.7
|
46 |
+
- cloudpathlib==0.18.1
|
47 |
+
- cloudpickle==3.0.0
|
48 |
+
- colorlog==6.8.2
|
49 |
+
- confection==0.1.5
|
50 |
+
- contourpy==1.2.1
|
51 |
+
- cycler==0.12.1
|
52 |
+
- cymem==2.0.8
|
53 |
+
- decorator==4.4.2
|
54 |
+
- defusedxml==0.7.1
|
55 |
+
- demucs==4.0.1
|
56 |
+
- dnspython==2.6.1
|
57 |
+
- docopt==0.6.2
|
58 |
+
- dora-search==0.1.12
|
59 |
+
- einops==0.8.0
|
60 |
+
- email-validator==2.2.0
|
61 |
+
- encodec==0.1.1
|
62 |
+
- exceptiongroup==1.2.2
|
63 |
+
- executing==2.0.1
|
64 |
+
- fastapi==0.111.0
|
65 |
+
- fastapi-cli==0.0.4
|
66 |
+
- fastjsonschema==2.20.0
|
67 |
+
- ffmpy==0.3.2
|
68 |
+
- filelock==3.15.4
|
69 |
+
- flashy==0.0.2
|
70 |
+
- fonttools==4.53.1
|
71 |
+
- fsspec==2024.6.1
|
72 |
+
- gitdb==4.0.11
|
73 |
+
- gitpython==3.1.43
|
74 |
+
- google-ai-generativelanguage==0.6.6
|
75 |
+
- google-api-core==2.19.1
|
76 |
+
- google-api-python-client==2.137.0
|
77 |
+
- google-auth==2.32.0
|
78 |
+
- google-auth-httplib2==0.2.0
|
79 |
+
- google-generativeai==0.7.2
|
80 |
+
- googleapis-common-protos==1.63.2
|
81 |
+
- gradio==4.38.1
|
82 |
+
- gradio-client==1.1.0
|
83 |
+
- grpcio==1.64.1
|
84 |
+
- grpcio-status==1.62.2
|
85 |
+
- h11==0.14.0
|
86 |
+
- httpcore==1.0.5
|
87 |
+
- httplib2==0.22.0
|
88 |
+
- httptools==0.6.1
|
89 |
+
- httpx==0.27.0
|
90 |
+
- huggingface-hub==0.23.4
|
91 |
+
- hydra-colorlog==1.2.0
|
92 |
+
- hydra-core==1.3.2
|
93 |
+
- idna==3.7
|
94 |
+
- imageio==2.34.2
|
95 |
+
- imageio-ffmpeg==0.5.1
|
96 |
+
- importlib-metadata==8.2.0
|
97 |
+
- importlib-resources==6.4.0
|
98 |
+
- ipython==8.12.3
|
99 |
+
- jedi==0.19.1
|
100 |
+
- jinja2==3.1.4
|
101 |
+
- joblib==1.4.2
|
102 |
+
- jsonschema==4.23.0
|
103 |
+
- jsonschema-specifications==2023.12.1
|
104 |
+
- julius==0.2.7
|
105 |
+
- jupyter-client==8.6.2
|
106 |
+
- jupyter-core==5.7.2
|
107 |
+
- jupyterlab-pygments==0.3.0
|
108 |
+
- kiwisolver==1.4.5
|
109 |
+
- lameenc==1.7.0
|
110 |
+
- langcodes==3.4.0
|
111 |
+
- language-data==1.2.0
|
112 |
+
- lazy-loader==0.4
|
113 |
+
- librosa==0.10.2.post1
|
114 |
+
- lightning-utilities==0.11.5
|
115 |
+
- llvmlite==0.43.0
|
116 |
+
- marisa-trie==1.2.0
|
117 |
+
- markdown-it-py==3.0.0
|
118 |
+
- markupsafe==2.1.5
|
119 |
+
- matplotlib==3.9.1
|
120 |
+
- matplotlib-inline==0.1.7
|
121 |
+
- mdurl==0.1.2
|
122 |
+
- mistune==3.0.2
|
123 |
+
- moviepy==1.0.3
|
124 |
+
- mpmath==1.3.0
|
125 |
+
- msgpack==1.0.8
|
126 |
+
- murmurhash==1.0.10
|
127 |
+
- nbclient==0.10.0
|
128 |
+
- nbconvert==7.16.4
|
129 |
+
- nbformat==5.10.4
|
130 |
+
- networkx==3.2.1
|
131 |
+
- num2words==0.5.13
|
132 |
+
- numba==0.60.0
|
133 |
+
- numpy==1.26.4
|
134 |
+
- nvidia-cublas-cu12==12.1.3.1
|
135 |
+
- nvidia-cuda-cupti-cu12==12.1.105
|
136 |
+
- nvidia-cuda-nvrtc-cu12==12.1.105
|
137 |
+
- nvidia-cuda-runtime-cu12==12.1.105
|
138 |
+
- nvidia-cudnn-cu12==8.9.2.26
|
139 |
+
- nvidia-cufft-cu12==11.0.2.54
|
140 |
+
- nvidia-curand-cu12==10.3.2.106
|
141 |
+
- nvidia-cusolver-cu12==11.4.5.107
|
142 |
+
- nvidia-cusparse-cu12==12.1.0.106
|
143 |
+
- nvidia-nccl-cu12==2.18.1
|
144 |
+
- nvidia-nvjitlink-cu12==12.5.82
|
145 |
+
- nvidia-nvtx-cu12==12.1.105
|
146 |
+
- omegaconf==2.3.0
|
147 |
+
- openunmix==1.3.0
|
148 |
+
- orjson==3.10.6
|
149 |
+
- packaging==24.1
|
150 |
+
- pandas==2.2.2
|
151 |
+
- pandocfilters==1.5.1
|
152 |
+
- parso==0.8.4
|
153 |
+
- pexpect==4.9.0
|
154 |
+
- pickleshare==0.7.5
|
155 |
+
- pillow==10.4.0
|
156 |
+
- pipreqs==0.5.0
|
157 |
+
- platformdirs==4.2.2
|
158 |
+
- pooch==1.8.2
|
159 |
+
- preshed==3.0.9
|
160 |
+
- proglog==0.1.10
|
161 |
+
- prompt-toolkit==3.0.47
|
162 |
+
- proto-plus==1.24.0
|
163 |
+
- protobuf==4.25.3
|
164 |
+
- psutil==6.0.0
|
165 |
+
- ptyprocess==0.7.0
|
166 |
+
- pure-eval==0.2.3
|
167 |
+
- pyarrow==16.1.0
|
168 |
+
- pyasn1==0.6.0
|
169 |
+
- pyasn1-modules==0.4.0
|
170 |
+
- pycparser==2.22
|
171 |
+
- pydantic==2.7.3
|
172 |
+
- pydantic-core==2.18.4
|
173 |
+
- pydeck==0.9.1
|
174 |
+
- pydub==0.25.1
|
175 |
+
- pygments==2.18.0
|
176 |
+
- pyparsing==3.1.2
|
177 |
+
- python-dateutil==2.9.0.post0
|
178 |
+
- python-dotenv==1.0.1
|
179 |
+
- python-multipart==0.0.9
|
180 |
+
- pytz==2024.1
|
181 |
+
- pyyaml==6.0.1
|
182 |
+
- pyzmq==26.1.0
|
183 |
+
- referencing==0.35.1
|
184 |
+
- regex==2024.5.15
|
185 |
+
- requests==2.32.3
|
186 |
+
- retrying==1.3.4
|
187 |
+
- rich==13.7.1
|
188 |
+
- rpds-py==0.19.0
|
189 |
+
- rsa==4.9
|
190 |
+
- ruff==0.5.2
|
191 |
+
- safetensors==0.4.3
|
192 |
+
- scikit-learn==1.5.1
|
193 |
+
- scipy==1.13.1
|
194 |
+
- semantic-version==2.10.0
|
195 |
+
- sentencepiece==0.2.0
|
196 |
+
- shellingham==1.5.4
|
197 |
+
- six==1.16.0
|
198 |
+
- smart-open==7.0.4
|
199 |
+
- smmap==5.0.1
|
200 |
+
- sniffio==1.3.1
|
201 |
+
- soundfile==0.12.1
|
202 |
+
- soupsieve==2.5
|
203 |
+
- soxr==0.3.7
|
204 |
+
- spacy==3.7.5
|
205 |
+
- spacy-legacy==3.0.12
|
206 |
+
- spacy-loggers==1.0.5
|
207 |
+
- srsly==2.4.8
|
208 |
+
- stack-data==0.6.3
|
209 |
+
- starlette==0.37.2
|
210 |
+
- streamlit==1.36.0
|
211 |
+
- submitit==1.5.1
|
212 |
+
- sympy==1.13.0
|
213 |
+
- tenacity==8.5.0
|
214 |
+
- thinc==8.2.5
|
215 |
+
- threadpoolctl==3.5.0
|
216 |
+
- tinycss2==1.3.0
|
217 |
+
- tokenizers==0.19.1
|
218 |
+
- toml==0.10.2
|
219 |
+
- tomlkit==0.12.0
|
220 |
+
- toolz==0.12.1
|
221 |
+
- --extra-index-url https://download.pytorch.org/whl/cu121
|
222 |
+
- torch==2.1.0
|
223 |
+
- torchaudio==2.1.0
|
224 |
+
- torchdata==0.7.0
|
225 |
+
- torchmetrics==1.4.0.post0
|
226 |
+
- torchtext==0.16.0
|
227 |
+
- torchvision==0.16.0
|
228 |
+
- tornado==6.4.1
|
229 |
+
- tqdm==4.66.4
|
230 |
+
- traitlets==5.14.3
|
231 |
+
- transformers==4.42.4
|
232 |
+
- treetable==0.2.5
|
233 |
+
- triton==2.1.0
|
234 |
+
- typer==0.12.3
|
235 |
+
- typing-extensions==4.12.2
|
236 |
+
- tzdata==2024.1
|
237 |
+
- ujson==5.10.0
|
238 |
+
- uritemplate==4.1.1
|
239 |
+
- urllib3==2.2.2
|
240 |
+
- uvicorn==0.30.1
|
241 |
+
- uvloop==0.19.0
|
242 |
+
- wasabi==1.1.3
|
243 |
+
- watchdog==4.0.1
|
244 |
+
- watchfiles==0.22.0
|
245 |
+
- wcwidth==0.2.13
|
246 |
+
- weasel==0.4.1
|
247 |
+
- webencodings==0.5.1
|
248 |
+
- websockets==11.0.3
|
249 |
+
- wrapt==1.16.0
|
250 |
+
- xformers==0.0.22.post7
|
251 |
+
- yarg==0.1.9
|
252 |
+
- zipp==3.19.2
|
id_cleaner.py
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import time
|
3 |
+
import shutil
|
4 |
+
import logging
|
5 |
+
from datetime import datetime, timedelta
|
6 |
+
from watchdog.observers import Observer
|
7 |
+
from watchdog.events import FileSystemEventHandler
|
8 |
+
|
9 |
+
# Configure logging
|
10 |
+
FORMAT = "%(asctime)s: %(levelname)s: %(message)s"
|
11 |
+
logging.basicConfig(filename="logs.log", level=logging.INFO, format=FORMAT)
|
12 |
+
STDERRLOGGER = logging.StreamHandler()
|
13 |
+
STDERRLOGGER.setFormatter(logging.Formatter(FORMAT))
|
14 |
+
logging.getLogger().addHandler(STDERRLOGGER)
|
15 |
+
|
16 |
+
class DirectoryCleanupHandler(FileSystemEventHandler):
|
17 |
+
def __init__(self, threshold_minutes=60, check_interval_minutes=5):
|
18 |
+
self.threshold = timedelta(minutes=threshold_minutes)
|
19 |
+
self.check_interval = check_interval_minutes * 60
|
20 |
+
self.last_check_time = datetime.now()
|
21 |
+
|
22 |
+
def on_modified(self, event):
|
23 |
+
if event.is_directory and event.src_path.startswith("_id_"):
|
24 |
+
logging.info(f"Detected modification in directory: {event.src_path}")
|
25 |
+
self.cleanup_directories()
|
26 |
+
|
27 |
+
def cleanup_directories(self):
|
28 |
+
now = datetime.now()
|
29 |
+
for dirpath, _, _ in os.walk("."):
|
30 |
+
if os.path.basename(dirpath).startswith("_id_"):
|
31 |
+
try:
|
32 |
+
mtime = os.path.getmtime(dirpath)
|
33 |
+
mtime_dt = datetime.fromtimestamp(mtime)
|
34 |
+
if now - mtime_dt > self.threshold:
|
35 |
+
logging.info(f"Deleting directory: {dirpath}")
|
36 |
+
shutil.rmtree(dirpath)
|
37 |
+
except Exception as e:
|
38 |
+
logging.error(f"Error deleting {dirpath}: {e}")
|
39 |
+
|
40 |
+
def start_cleanup_loop(self):
|
41 |
+
while True:
|
42 |
+
current_time = datetime.now()
|
43 |
+
if (
|
44 |
+
current_time - self.last_check_time
|
45 |
+
).total_seconds() >= self.check_interval:
|
46 |
+
logging.info("Woke up to check directories")
|
47 |
+
self.cleanup_directories()
|
48 |
+
self.last_check_time = current_time
|
49 |
+
time.sleep(self.check_interval)
|
50 |
+
|
51 |
+
|
52 |
+
if __name__ == "__main__":
|
53 |
+
logging.info("Starting directory cleanup script")
|
54 |
+
event_handler = DirectoryCleanupHandler(
|
55 |
+
threshold_minutes=60, check_interval_minutes=30
|
56 |
+
)
|
57 |
+
observer = Observer()
|
58 |
+
observer.schedule(event_handler, path=".", recursive=True)
|
59 |
+
observer.start()
|
60 |
+
|
61 |
+
try:
|
62 |
+
event_handler.start_cleanup_loop()
|
63 |
+
except KeyboardInterrupt:
|
64 |
+
logging.info("Stopping directory cleanup script due to keyboard interrupt")
|
65 |
+
observer.stop()
|
66 |
+
observer.join()
|
logger.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import logging
|
2 |
+
|
3 |
+
FORMAT = "%(asctime)s: %(levelname)s: %(message)s"
|
4 |
+
logging.basicConfig(filename='logs.log', level=logging.INFO, format=FORMAT)
|
5 |
+
STDERRLOGGER = logging.StreamHandler()
|
6 |
+
STDERRLOGGER.setFormatter(logging.Formatter(FORMAT))
|
7 |
+
logging.getLogger().addHandler(STDERRLOGGER)
|
main.py
ADDED
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from engine import DescribeVideo, GenerateAudio
|
3 |
+
import os
|
4 |
+
from moviepy.editor import VideoFileClip, AudioFileClip, CompositeAudioClip
|
5 |
+
from moviepy.audio.fx.volumex import volumex
|
6 |
+
from streamlit.runtime.scriptrunner import get_script_run_ctx
|
7 |
+
|
8 |
+
|
9 |
+
def get_session_id():
|
10 |
+
session_id = get_script_run_ctx().session_id
|
11 |
+
session_id = session_id.replace("-", "_")
|
12 |
+
session_id = "_id_" + session_id
|
13 |
+
return session_id
|
14 |
+
|
15 |
+
|
16 |
+
user_session_id = get_session_id()
|
17 |
+
os.makedirs(user_session_id, exist_ok=True)
|
18 |
+
# Define model maps
|
19 |
+
video_model_map = {
|
20 |
+
"Fast": "flash",
|
21 |
+
"Quality": "pro",
|
22 |
+
}
|
23 |
+
|
24 |
+
music_model_map = {
|
25 |
+
"Fast": "musicgen-stereo-small",
|
26 |
+
"Balanced": "musicgen-stereo-medium",
|
27 |
+
"Quality": "musicgen-stereo-large",
|
28 |
+
}
|
29 |
+
|
30 |
+
# music_model_map = {
|
31 |
+
# "Fast": "facebook/musicgen-melody",
|
32 |
+
# "Quality": "facebook/musicgen-melody-large",
|
33 |
+
# }
|
34 |
+
|
35 |
+
genre_map = {
|
36 |
+
"None": None,
|
37 |
+
"Pop": "Pop",
|
38 |
+
"Rock": "Rock",
|
39 |
+
"Hip Hop": "Hip-Hop/Rap",
|
40 |
+
"Jazz": "Jazz",
|
41 |
+
"Classical": "Classical",
|
42 |
+
"Blues": "Blues",
|
43 |
+
"Country": "Country",
|
44 |
+
"EDM": "Electronic/Dance",
|
45 |
+
"Metal": "Metal",
|
46 |
+
"Disco": "Disco",
|
47 |
+
"Lo-Fi": "Lo-Fi",
|
48 |
+
}
|
49 |
+
|
50 |
+
# Streamlit page configuration
|
51 |
+
st.set_page_config(
|
52 |
+
page_title="VidTune: Where Videos Find Their Melody",
|
53 |
+
layout="centered",
|
54 |
+
page_icon="assets/favicon.png",
|
55 |
+
)
|
56 |
+
|
57 |
+
left_co, cent_co, last_co = st.columns(3)
|
58 |
+
with cent_co:
|
59 |
+
st.image("assets/VidTune-Logo-Without-BG.png", use_column_width=False, width=200)
|
60 |
+
|
61 |
+
# Title and Description
|
62 |
+
st.markdown(
|
63 |
+
"""
|
64 |
+
<style>
|
65 |
+
h2, p, div, img {
|
66 |
+
text-align: center;
|
67 |
+
}
|
68 |
+
</style>
|
69 |
+
<div style="font-size: 35px; font-weight: bold;">VidTune: Where Videos Find Their Melody</div>
|
70 |
+
<p>VidTune is a web application to effortlessly tailor perfect soundtracks for your videos with AI.</p>
|
71 |
+
""",
|
72 |
+
unsafe_allow_html=True,
|
73 |
+
)
|
74 |
+
|
75 |
+
# Initialize session state for advanced settings and other inputs
|
76 |
+
if "show_advanced" not in st.session_state:
|
77 |
+
st.session_state.show_advanced = False
|
78 |
+
if "video_model" not in st.session_state:
|
79 |
+
st.session_state.video_model = "Fast"
|
80 |
+
if "music_model" not in st.session_state:
|
81 |
+
st.session_state.music_model = "Fast"
|
82 |
+
if "num_samples" not in st.session_state:
|
83 |
+
st.session_state.num_samples = 3
|
84 |
+
if "music_genre" not in st.session_state:
|
85 |
+
st.session_state.music_genre = None
|
86 |
+
if "music_bpm" not in st.session_state:
|
87 |
+
st.session_state.music_bpm = 100
|
88 |
+
if "user_keywords" not in st.session_state:
|
89 |
+
st.session_state.user_keywords = None
|
90 |
+
if "selected_audio" not in st.session_state:
|
91 |
+
st.session_state.selected_audio = "None"
|
92 |
+
if "audio_paths" not in st.session_state:
|
93 |
+
st.session_state.audio_paths = []
|
94 |
+
if "selected_audio_path" not in st.session_state:
|
95 |
+
st.session_state.selected_audio_path = None
|
96 |
+
if "orig_audio_vol" not in st.session_state:
|
97 |
+
st.session_state.orig_audio_vol = 100
|
98 |
+
if "generated_audio_vol" not in st.session_state:
|
99 |
+
st.session_state.generated_audio_vol = 100
|
100 |
+
if "generate_button_flag" not in st.session_state:
|
101 |
+
st.session_state.generate_button_flag = False
|
102 |
+
if "video_description_content" not in st.session_state:
|
103 |
+
st.session_state.video_description_content = ""
|
104 |
+
if "music_prompt" not in st.session_state:
|
105 |
+
st.session_state.music_prompt = ""
|
106 |
+
if "audio_mix_flag" not in st.session_state:
|
107 |
+
st.session_state.audio_mix_flag = False
|
108 |
+
if "google_api_key" not in st.session_state:
|
109 |
+
st.session_state.google_api_key = ""
|
110 |
+
|
111 |
+
# Sidebar
|
112 |
+
st.sidebar.title("Configuration")
|
113 |
+
|
114 |
+
# Google API Key
|
115 |
+
st.session_state.google_api_key = st.sidebar.text_input(
|
116 |
+
"Enter your [Google API Key](https://ai.google.dev/gemini-api/docs/api-key) to get started :",
|
117 |
+
st.session_state.google_api_key,
|
118 |
+
type="password",
|
119 |
+
)
|
120 |
+
|
121 |
+
if not st.session_state.google_api_key:
|
122 |
+
st.warning("Please enter your Google API Key to proceed.")
|
123 |
+
st.stop()
|
124 |
+
|
125 |
+
# Basic Settings
|
126 |
+
st.session_state.video_model = st.sidebar.selectbox(
|
127 |
+
"Select Video Descriptor",
|
128 |
+
["Fast", "Quality"],
|
129 |
+
index=["Fast", "Quality"].index(st.session_state.video_model),
|
130 |
+
)
|
131 |
+
st.session_state.music_model = st.sidebar.selectbox(
|
132 |
+
"Select Music Generator",
|
133 |
+
["Fast", "Balanced", "Quality"],
|
134 |
+
index=["Fast", "Balanced", "Quality"].index(st.session_state.music_model),
|
135 |
+
)
|
136 |
+
st.session_state.num_samples = st.sidebar.slider(
|
137 |
+
"Number of samples", 1, 5, st.session_state.num_samples
|
138 |
+
)
|
139 |
+
|
140 |
+
# Sidebar for advanced settings
|
141 |
+
with st.sidebar:
|
142 |
+
# Create a placeholder for the advanced settings button
|
143 |
+
placeholder = st.empty()
|
144 |
+
|
145 |
+
# Button to toggle advanced settings
|
146 |
+
if placeholder.button("Advanced"):
|
147 |
+
st.session_state.show_advanced = not st.session_state.show_advanced
|
148 |
+
st.rerun() # Refresh the layout after button click
|
149 |
+
|
150 |
+
# Display advanced settings if enabled
|
151 |
+
if st.session_state.show_advanced:
|
152 |
+
# Advanced settings
|
153 |
+
st.session_state.music_bpm = st.sidebar.slider("Beats Per Minute", 35, 180, 100)
|
154 |
+
st.session_state.music_genre = st.sidebar.selectbox(
|
155 |
+
"Select Music Genre",
|
156 |
+
list(genre_map.keys()),
|
157 |
+
index=(
|
158 |
+
list(genre_map.keys()).index(st.session_state.music_genre)
|
159 |
+
if st.session_state.music_genre in genre_map.keys()
|
160 |
+
else 0
|
161 |
+
),
|
162 |
+
)
|
163 |
+
st.session_state.user_keywords = st.sidebar.text_input(
|
164 |
+
"User Keywords",
|
165 |
+
value=st.session_state.user_keywords,
|
166 |
+
help="Enter keywords separated by commas.",
|
167 |
+
)
|
168 |
+
else:
|
169 |
+
st.session_state.music_genre = None
|
170 |
+
st.session_state.music_bpm = None
|
171 |
+
st.session_state.user_keywords = None
|
172 |
+
|
173 |
+
# Generate Button
|
174 |
+
generate_button = st.sidebar.button("Generate Music")
|
175 |
+
|
176 |
+
|
177 |
+
# Cache the model loading
|
178 |
+
@st.cache_resource
|
179 |
+
def load_models(video_model_key, music_model_key, google_api_key):
|
180 |
+
video_descriptor = DescribeVideo(
|
181 |
+
model=video_model_map[video_model_key], google_api_key=google_api_key
|
182 |
+
)
|
183 |
+
audio_generator = GenerateAudio(model=music_model_map[music_model_key])
|
184 |
+
if audio_generator.device == "cpu":
|
185 |
+
st.warning(
|
186 |
+
"The music generator model is running on CPU. For faster results, consider using a GPU."
|
187 |
+
)
|
188 |
+
return video_descriptor, audio_generator
|
189 |
+
|
190 |
+
|
191 |
+
# Load models
|
192 |
+
video_descriptor, audio_generator = load_models(
|
193 |
+
st.session_state.video_model,
|
194 |
+
st.session_state.music_model,
|
195 |
+
st.session_state.google_api_key,
|
196 |
+
)
|
197 |
+
|
198 |
+
# Video Uploader
|
199 |
+
uploaded_video = st.file_uploader("Upload Video", type=["mp4"])
|
200 |
+
if uploaded_video is not None:
|
201 |
+
st.session_state.uploaded_video = uploaded_video
|
202 |
+
with open(f"{user_session_id}/temp.mp4", mode="wb") as w:
|
203 |
+
w.write(uploaded_video.getvalue())
|
204 |
+
|
205 |
+
# Video Player
|
206 |
+
if os.path.exists(f"{user_session_id}/temp.mp4") and uploaded_video is not None:
|
207 |
+
st.video(uploaded_video)
|
208 |
+
|
209 |
+
# Submit button if video is not uploaded
|
210 |
+
if generate_button:
|
211 |
+
if uploaded_video is None:
|
212 |
+
st.error("Please upload a video before generating music.")
|
213 |
+
st.stop()
|
214 |
+
|
215 |
+
with st.spinner("Analyzing video..."):
|
216 |
+
video_description = video_descriptor.describe_video(
|
217 |
+
f"{user_session_id}/temp.mp4",
|
218 |
+
genre=st.session_state.music_genre,
|
219 |
+
bpm=st.session_state.music_bpm,
|
220 |
+
user_keywords=st.session_state.user_keywords,
|
221 |
+
)
|
222 |
+
video_duration = VideoFileClip(f"{user_session_id}/temp.mp4").duration
|
223 |
+
st.session_state.video_description_content = video_description[
|
224 |
+
"Content Description"
|
225 |
+
]
|
226 |
+
st.session_state.music_prompt = video_description["Music Prompt"]
|
227 |
+
|
228 |
+
st.success("Video description generated successfully.")
|
229 |
+
st.session_state.generate_button_flag = True
|
230 |
+
|
231 |
+
# Display Video Description and Music Prompt
|
232 |
+
if st.session_state.generate_button_flag:
|
233 |
+
st.text_area(
|
234 |
+
"Video Description",
|
235 |
+
st.session_state.video_description_content,
|
236 |
+
disabled=True,
|
237 |
+
height=120,
|
238 |
+
)
|
239 |
+
music_prompt = st.text_area(
|
240 |
+
"Music Prompt",
|
241 |
+
st.session_state.music_prompt,
|
242 |
+
disabled=True,
|
243 |
+
height=120,
|
244 |
+
)
|
245 |
+
|
246 |
+
if generate_button:
|
247 |
+
# Generate Music
|
248 |
+
with st.spinner("Generating music..."):
|
249 |
+
if video_duration > 30:
|
250 |
+
st.warning(
|
251 |
+
"Due to hardware limitations, the maximum music length is capped at 30 seconds."
|
252 |
+
)
|
253 |
+
music_prompt = [st.session_state.music_prompt] * st.session_state.num_samples
|
254 |
+
audio_generator.generate_audio(music_prompt, duration=video_duration)
|
255 |
+
st.session_state.audio_paths = audio_generator.save_audio()
|
256 |
+
st.success("Music generated successfully.")
|
257 |
+
st.balloons()
|
258 |
+
|
259 |
+
|
260 |
+
# Callback function for radio button selection change
|
261 |
+
def on_audio_selection_change():
|
262 |
+
st.session_state.audio_mix_flag = False
|
263 |
+
selected_audio_index = st.session_state.selected_audio
|
264 |
+
if selected_audio_index > 0:
|
265 |
+
st.session_state.selected_audio_path = st.session_state.audio_paths[
|
266 |
+
selected_audio_index - 1
|
267 |
+
]
|
268 |
+
else:
|
269 |
+
st.session_state.selected_audio_path = None
|
270 |
+
|
271 |
+
|
272 |
+
if st.session_state.audio_paths:
|
273 |
+
# Dropdown to select one of the generated audio files
|
274 |
+
audio_options = ["None"] + [
|
275 |
+
f"Generated Music {i+1}" for i in range(len(st.session_state.audio_paths))
|
276 |
+
]
|
277 |
+
|
278 |
+
# Display the audio files
|
279 |
+
for i, audio_path in enumerate(st.session_state.audio_paths):
|
280 |
+
st.audio(audio_path, format="audio/wav")
|
281 |
+
|
282 |
+
selected_audio_index = st.selectbox(
|
283 |
+
"Select one of the generated audio files for further processing:",
|
284 |
+
range(len(audio_options)),
|
285 |
+
format_func=lambda x: audio_options[x],
|
286 |
+
index=0,
|
287 |
+
key="selected_audio",
|
288 |
+
on_change=on_audio_selection_change,
|
289 |
+
)
|
290 |
+
|
291 |
+
# Button to confirm the selection
|
292 |
+
if st.button("Add Generated Music to Video"):
|
293 |
+
st.session_state.audio_mix_flag = True
|
294 |
+
|
295 |
+
# Handle Audio Mixing and Export
|
296 |
+
if st.session_state.selected_audio_path is not None and st.session_state.audio_mix_flag:
|
297 |
+
with st.spinner("Mixing Audio..."):
|
298 |
+
orig_clip = VideoFileClip(f"{user_session_id}/temp.mp4")
|
299 |
+
orig_clip_audio = orig_clip.audio
|
300 |
+
generated_audio = AudioFileClip(st.session_state.selected_audio_path)
|
301 |
+
|
302 |
+
st.session_state.orig_audio_vol = st.slider(
|
303 |
+
"Original Audio Volume",
|
304 |
+
0,
|
305 |
+
200,
|
306 |
+
st.session_state.orig_audio_vol,
|
307 |
+
format="%d%%",
|
308 |
+
)
|
309 |
+
|
310 |
+
st.session_state.generated_audio_vol = st.slider(
|
311 |
+
"Generated Music Volume",
|
312 |
+
0,
|
313 |
+
200,
|
314 |
+
st.session_state.generated_audio_vol,
|
315 |
+
format="%d%%",
|
316 |
+
)
|
317 |
+
|
318 |
+
orig_clip_audio = volumex(
|
319 |
+
orig_clip_audio, float(st.session_state.orig_audio_vol / 100)
|
320 |
+
)
|
321 |
+
generated_audio = volumex(
|
322 |
+
generated_audio, float(st.session_state.generated_audio_vol / 100)
|
323 |
+
)
|
324 |
+
|
325 |
+
orig_clip.audio = CompositeAudioClip([orig_clip_audio, generated_audio])
|
326 |
+
|
327 |
+
final_video_path = f"{user_session_id}/out_tmp.mp4"
|
328 |
+
orig_clip.write_videofile(final_video_path)
|
329 |
+
|
330 |
+
orig_clip.close()
|
331 |
+
generated_audio.close()
|
332 |
+
|
333 |
+
st.session_state.final_video_path = final_video_path
|
334 |
+
|
335 |
+
st.video(final_video_path)
|
336 |
+
if st.session_state.final_video_path:
|
337 |
+
with open(st.session_state.final_video_path, "rb") as video_file:
|
338 |
+
st.download_button(
|
339 |
+
label="Download final video",
|
340 |
+
data=video_file,
|
341 |
+
file_name="final_video.mp4",
|
342 |
+
mime="video/mp4",
|
343 |
+
)
|
requirements.txt
ADDED
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
aiofiles==23.2.1
|
2 |
+
altair==5.3.0
|
3 |
+
annotated-types==0.7.0
|
4 |
+
antlr4-python3-runtime==4.9.3
|
5 |
+
anyio==4.4.0
|
6 |
+
asttokens==2.4.1
|
7 |
+
attrs==23.2.0
|
8 |
+
audiocraft==1.3.0
|
9 |
+
audioread==3.0.1
|
10 |
+
av==11.0.0
|
11 |
+
backcall==0.2.0
|
12 |
+
beautifulsoup4==4.12.3
|
13 |
+
bleach==6.1.0
|
14 |
+
blinker==1.8.2
|
15 |
+
blis==0.7.11
|
16 |
+
cachetools==5.3.3
|
17 |
+
catalogue==2.0.10
|
18 |
+
certifi==2024.7.4
|
19 |
+
cffi==1.16.0
|
20 |
+
charset-normalizer==3.3.2
|
21 |
+
click==8.1.7
|
22 |
+
cloudpathlib==0.18.1
|
23 |
+
cloudpickle==3.0.0
|
24 |
+
colorlog==6.8.2
|
25 |
+
confection==0.1.5
|
26 |
+
contourpy==1.2.1
|
27 |
+
cycler==0.12.1
|
28 |
+
cymem==2.0.8
|
29 |
+
decorator==4.4.2
|
30 |
+
defusedxml==0.7.1
|
31 |
+
demucs==4.0.1
|
32 |
+
dnspython==2.6.1
|
33 |
+
docopt==0.6.2
|
34 |
+
dora_search==0.1.12
|
35 |
+
einops==0.8.0
|
36 |
+
email_validator==2.2.0
|
37 |
+
encodec==0.1.1
|
38 |
+
exceptiongroup==1.2.2
|
39 |
+
executing==2.0.1
|
40 |
+
fastapi==0.111.0
|
41 |
+
fastapi-cli==0.0.4
|
42 |
+
fastjsonschema==2.20.0
|
43 |
+
ffmpy==0.3.2
|
44 |
+
filelock==3.15.4
|
45 |
+
flashy==0.0.2
|
46 |
+
fonttools==4.53.1
|
47 |
+
fsspec==2024.6.1
|
48 |
+
gitdb==4.0.11
|
49 |
+
GitPython==3.1.43
|
50 |
+
google-ai-generativelanguage==0.6.6
|
51 |
+
google-api-core==2.19.1
|
52 |
+
google-api-python-client==2.137.0
|
53 |
+
google-auth==2.32.0
|
54 |
+
google-auth-httplib2==0.2.0
|
55 |
+
google-generativeai==0.7.2
|
56 |
+
googleapis-common-protos==1.63.2
|
57 |
+
gradio==4.38.1
|
58 |
+
gradio_client==1.1.0
|
59 |
+
grpcio==1.64.1
|
60 |
+
grpcio-status==1.62.2
|
61 |
+
h11==0.14.0
|
62 |
+
httpcore==1.0.5
|
63 |
+
httplib2==0.22.0
|
64 |
+
httptools==0.6.1
|
65 |
+
httpx==0.27.0
|
66 |
+
huggingface-hub==0.23.4
|
67 |
+
hydra-colorlog==1.2.0
|
68 |
+
hydra-core==1.3.2
|
69 |
+
idna==3.7
|
70 |
+
imageio==2.34.2
|
71 |
+
imageio-ffmpeg==0.5.1
|
72 |
+
importlib_metadata==8.2.0
|
73 |
+
importlib_resources==6.4.0
|
74 |
+
ipython==8.12.3
|
75 |
+
jedi==0.19.1
|
76 |
+
Jinja2==3.1.4
|
77 |
+
joblib==1.4.2
|
78 |
+
jsonschema==4.23.0
|
79 |
+
jsonschema-specifications==2023.12.1
|
80 |
+
julius==0.2.7
|
81 |
+
jupyter_client==8.6.2
|
82 |
+
jupyter_core==5.7.2
|
83 |
+
jupyterlab_pygments==0.3.0
|
84 |
+
kiwisolver==1.4.5
|
85 |
+
lameenc==1.7.0
|
86 |
+
langcodes==3.4.0
|
87 |
+
language_data==1.2.0
|
88 |
+
lazy_loader==0.4
|
89 |
+
librosa==0.10.2.post1
|
90 |
+
lightning-utilities==0.11.5
|
91 |
+
llvmlite==0.43.0
|
92 |
+
marisa-trie==1.2.0
|
93 |
+
markdown-it-py==3.0.0
|
94 |
+
MarkupSafe==2.1.5
|
95 |
+
matplotlib==3.9.1
|
96 |
+
matplotlib-inline==0.1.7
|
97 |
+
mdurl==0.1.2
|
98 |
+
mistune==3.0.2
|
99 |
+
moviepy==1.0.3
|
100 |
+
mpmath==1.3.0
|
101 |
+
msgpack==1.0.8
|
102 |
+
murmurhash==1.0.10
|
103 |
+
nbclient==0.10.0
|
104 |
+
nbconvert==7.16.4
|
105 |
+
nbformat==5.10.4
|
106 |
+
networkx==3.2.1
|
107 |
+
num2words==0.5.13
|
108 |
+
numba==0.60.0
|
109 |
+
numpy==1.26.4
|
110 |
+
nvidia-cublas-cu12==12.1.3.1
|
111 |
+
nvidia-cuda-cupti-cu12==12.1.105
|
112 |
+
nvidia-cuda-nvrtc-cu12==12.1.105
|
113 |
+
nvidia-cuda-runtime-cu12==12.1.105
|
114 |
+
nvidia-cudnn-cu12==8.9.2.26
|
115 |
+
nvidia-cufft-cu12==11.0.2.54
|
116 |
+
nvidia-curand-cu12==10.3.2.106
|
117 |
+
nvidia-cusolver-cu12==11.4.5.107
|
118 |
+
nvidia-cusparse-cu12==12.1.0.106
|
119 |
+
nvidia-nccl-cu12==2.18.1
|
120 |
+
nvidia-nvjitlink-cu12==12.5.82
|
121 |
+
nvidia-nvtx-cu12==12.1.105
|
122 |
+
omegaconf==2.3.0
|
123 |
+
openunmix==1.3.0
|
124 |
+
orjson==3.10.6
|
125 |
+
packaging==24.1
|
126 |
+
pandas==2.2.2
|
127 |
+
pandocfilters==1.5.1
|
128 |
+
parso==0.8.4
|
129 |
+
pexpect==4.9.0
|
130 |
+
pickleshare==0.7.5
|
131 |
+
pillow==10.4.0
|
132 |
+
pipreqs==0.5.0
|
133 |
+
platformdirs==4.2.2
|
134 |
+
pooch==1.8.2
|
135 |
+
preshed==3.0.9
|
136 |
+
proglog==0.1.10
|
137 |
+
prompt_toolkit==3.0.47
|
138 |
+
proto-plus==1.24.0
|
139 |
+
protobuf==4.25.3
|
140 |
+
psutil==6.0.0
|
141 |
+
ptyprocess==0.7.0
|
142 |
+
pure_eval==0.2.3
|
143 |
+
pyarrow==16.1.0
|
144 |
+
pyasn1==0.6.0
|
145 |
+
pyasn1_modules==0.4.0
|
146 |
+
pycparser==2.22
|
147 |
+
pydantic==2.7.3
|
148 |
+
pydantic_core==2.18.4
|
149 |
+
pydeck==0.9.1
|
150 |
+
pydub==0.25.1
|
151 |
+
Pygments==2.18.0
|
152 |
+
pyparsing==3.1.2
|
153 |
+
python-dateutil==2.9.0.post0
|
154 |
+
python-dotenv==1.0.1
|
155 |
+
python-multipart==0.0.9
|
156 |
+
pytz==2024.1
|
157 |
+
PyYAML==6.0.1
|
158 |
+
pyzmq==26.1.0
|
159 |
+
referencing==0.35.1
|
160 |
+
regex==2024.5.15
|
161 |
+
requests==2.32.3
|
162 |
+
retrying==1.3.4
|
163 |
+
rich==13.7.1
|
164 |
+
rpds-py==0.19.0
|
165 |
+
rsa==4.9
|
166 |
+
ruff==0.5.2
|
167 |
+
safetensors==0.4.3
|
168 |
+
scikit-learn==1.5.1
|
169 |
+
scipy==1.13.1
|
170 |
+
semantic-version==2.10.0
|
171 |
+
sentencepiece==0.2.0
|
172 |
+
shellingham==1.5.4
|
173 |
+
six==1.16.0
|
174 |
+
smart-open==7.0.4
|
175 |
+
smmap==5.0.1
|
176 |
+
sniffio==1.3.1
|
177 |
+
soundfile==0.12.1
|
178 |
+
soupsieve==2.5
|
179 |
+
soxr==0.3.7
|
180 |
+
spacy==3.7.5
|
181 |
+
spacy-legacy==3.0.12
|
182 |
+
spacy-loggers==1.0.5
|
183 |
+
srsly==2.4.8
|
184 |
+
stack-data==0.6.3
|
185 |
+
starlette==0.37.2
|
186 |
+
streamlit==1.36.0
|
187 |
+
submitit==1.5.1
|
188 |
+
sympy==1.13.0
|
189 |
+
tenacity==8.5.0
|
190 |
+
thinc==8.2.5
|
191 |
+
threadpoolctl==3.5.0
|
192 |
+
tinycss2==1.3.0
|
193 |
+
tokenizers==0.19.1
|
194 |
+
toml==0.10.2
|
195 |
+
tomlkit==0.12.0
|
196 |
+
toolz==0.12.1
|
197 |
+
--extra-index-url https://download.pytorch.org/whl/cu121
|
198 |
+
torch==2.1.0
|
199 |
+
torchaudio==2.1.0
|
200 |
+
torchdata==0.7.0
|
201 |
+
torchmetrics==1.4.0.post0
|
202 |
+
torchtext==0.16.0
|
203 |
+
torchvision==0.16.0
|
204 |
+
tornado==6.4.1
|
205 |
+
tqdm==4.66.4
|
206 |
+
traitlets==5.14.3
|
207 |
+
transformers==4.42.4
|
208 |
+
treetable==0.2.5
|
209 |
+
triton==2.1.0
|
210 |
+
typer==0.12.3
|
211 |
+
typing_extensions==4.12.2
|
212 |
+
tzdata==2024.1
|
213 |
+
ujson==5.10.0
|
214 |
+
uritemplate==4.1.1
|
215 |
+
urllib3==2.2.2
|
216 |
+
uvicorn==0.30.1
|
217 |
+
uvloop==0.19.0
|
218 |
+
wasabi==1.1.3
|
219 |
+
watchdog==4.0.1
|
220 |
+
watchfiles==0.22.0
|
221 |
+
wcwidth==0.2.13
|
222 |
+
weasel==0.4.1
|
223 |
+
webencodings==0.5.1
|
224 |
+
websockets==11.0.3
|
225 |
+
wrapt==1.16.0
|
226 |
+
xformers==0.0.22.post7
|
227 |
+
yarg==0.1.9
|
228 |
+
zipp==3.19.2
|