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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Created by https://www.toptal.com/developers/gitignore/api/windows,macos,linux,dotenv,python
|
2 |
+
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,macos,linux,dotenv,python
|
3 |
+
|
4 |
+
### dotenv ###
|
5 |
+
.env
|
6 |
+
|
7 |
+
### Linux ###
|
8 |
+
*~
|
9 |
+
|
10 |
+
# temporary files which can be created if a process still has a handle open of a deleted file
|
11 |
+
.fuse_hidden*
|
12 |
+
|
13 |
+
# KDE directory preferences
|
14 |
+
.directory
|
15 |
+
|
16 |
+
# Linux trash folder which might appear on any partition or disk
|
17 |
+
.Trash-*
|
18 |
+
|
19 |
+
# .nfs files are created when an open file is removed but is still being accessed
|
20 |
+
.nfs*
|
21 |
+
|
22 |
+
### macOS ###
|
23 |
+
# General
|
24 |
+
.DS_Store
|
25 |
+
.AppleDouble
|
26 |
+
.LSOverride
|
27 |
+
|
28 |
+
# Icon must end with two \r
|
29 |
+
Icon
|
30 |
+
|
31 |
+
# Thumbnails
|
32 |
+
._*
|
33 |
+
|
34 |
+
# Files that might appear in the root of a volume
|
35 |
+
.DocumentRevisions-V100
|
36 |
+
.fseventsd
|
37 |
+
.Spotlight-V100
|
38 |
+
.TemporaryItems
|
39 |
+
.Trashes
|
40 |
+
.VolumeIcon.icns
|
41 |
+
.com.apple.timemachine.donotpresent
|
42 |
+
|
43 |
+
# Directories potentially created on remote AFP share
|
44 |
+
.AppleDB
|
45 |
+
.AppleDesktop
|
46 |
+
Network Trash Folder
|
47 |
+
Temporary Items
|
48 |
+
.apdisk
|
49 |
+
|
50 |
+
### macOS Patch ###
|
51 |
+
# iCloud generated files
|
52 |
+
*.icloud
|
53 |
+
|
54 |
+
### Python ###
|
55 |
+
# Byte-compiled / optimized / DLL files
|
56 |
+
__pycache__/
|
57 |
+
*.py[cod]
|
58 |
+
*$py.class
|
59 |
+
|
60 |
+
# C extensions
|
61 |
+
*.so
|
62 |
+
|
63 |
+
# Distribution / packaging
|
64 |
+
.Python
|
65 |
+
build/
|
66 |
+
develop-eggs/
|
67 |
+
dist/
|
68 |
+
downloads/
|
69 |
+
eggs/
|
70 |
+
.eggs/
|
71 |
+
lib/
|
72 |
+
lib64/
|
73 |
+
parts/
|
74 |
+
sdist/
|
75 |
+
var/
|
76 |
+
wheels/
|
77 |
+
share/python-wheels/
|
78 |
+
*.egg-info/
|
79 |
+
.installed.cfg
|
80 |
+
*.egg
|
81 |
+
MANIFEST
|
82 |
+
|
83 |
+
# PyInstaller
|
84 |
+
# Usually these files are written by a python script from a template
|
85 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
86 |
+
*.manifest
|
87 |
+
*.spec
|
88 |
+
|
89 |
+
# Installer logs
|
90 |
+
pip-log.txt
|
91 |
+
pip-delete-this-directory.txt
|
92 |
+
|
93 |
+
# Unit test / coverage reports
|
94 |
+
htmlcov/
|
95 |
+
.tox/
|
96 |
+
.nox/
|
97 |
+
.coverage
|
98 |
+
.coverage.*
|
99 |
+
.cache
|
100 |
+
nosetests.xml
|
101 |
+
coverage.xml
|
102 |
+
*.cover
|
103 |
+
*.py,cover
|
104 |
+
.hypothesis/
|
105 |
+
.pytest_cache/
|
106 |
+
cover/
|
107 |
+
|
108 |
+
# Translations
|
109 |
+
*.mo
|
110 |
+
*.pot
|
111 |
+
|
112 |
+
# Django stuff:
|
113 |
+
*.log
|
114 |
+
local_settings.py
|
115 |
+
db.sqlite3
|
116 |
+
db.sqlite3-journal
|
117 |
+
|
118 |
+
# Flask stuff:
|
119 |
+
instance/
|
120 |
+
.webassets-cache
|
121 |
+
|
122 |
+
# Scrapy stuff:
|
123 |
+
.scrapy
|
124 |
+
|
125 |
+
# Sphinx documentation
|
126 |
+
docs/_build/
|
127 |
+
|
128 |
+
# PyBuilder
|
129 |
+
.pybuilder/
|
130 |
+
target/
|
131 |
+
|
132 |
+
# Jupyter Notebook
|
133 |
+
.ipynb_checkpoints
|
134 |
+
|
135 |
+
# IPython
|
136 |
+
profile_default/
|
137 |
+
ipython_config.py
|
138 |
+
|
139 |
+
# pyenv
|
140 |
+
# For a library or package, you might want to ignore these files since the code is
|
141 |
+
# intended to run in multiple environments; otherwise, check them in:
|
142 |
+
# .python-version
|
143 |
+
|
144 |
+
# pipenv
|
145 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
146 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
147 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
148 |
+
# install all needed dependencies.
|
149 |
+
#Pipfile.lock
|
150 |
+
|
151 |
+
# poetry
|
152 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
153 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
154 |
+
# commonly ignored for libraries.
|
155 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
156 |
+
#poetry.lock
|
157 |
+
|
158 |
+
# pdm
|
159 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
160 |
+
#pdm.lock
|
161 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
162 |
+
# in version control.
|
163 |
+
# https://pdm.fming.dev/#use-with-ide
|
164 |
+
.pdm.toml
|
165 |
+
|
166 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
167 |
+
__pypackages__/
|
168 |
+
|
169 |
+
# Celery stuff
|
170 |
+
celerybeat-schedule
|
171 |
+
celerybeat.pid
|
172 |
+
|
173 |
+
# SageMath parsed files
|
174 |
+
*.sage.py
|
175 |
+
|
176 |
+
# Environments
|
177 |
+
.venv
|
178 |
+
env/
|
179 |
+
venv/
|
180 |
+
ENV/
|
181 |
+
env.bak/
|
182 |
+
venv.bak/
|
183 |
+
|
184 |
+
# Spyder project settings
|
185 |
+
.spyderproject
|
186 |
+
.spyproject
|
187 |
+
|
188 |
+
# Rope project settings
|
189 |
+
.ropeproject
|
190 |
+
|
191 |
+
# mkdocs documentation
|
192 |
+
/site
|
193 |
+
|
194 |
+
# mypy
|
195 |
+
.mypy_cache/
|
196 |
+
.dmypy.json
|
197 |
+
dmypy.json
|
198 |
+
|
199 |
+
# Pyre type checker
|
200 |
+
.pyre/
|
201 |
+
|
202 |
+
# pytype static type analyzer
|
203 |
+
.pytype/
|
204 |
+
|
205 |
+
# Cython debug symbols
|
206 |
+
cython_debug/
|
207 |
+
|
208 |
+
# PyCharm
|
209 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
210 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
211 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
212 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
213 |
+
#.idea/
|
214 |
+
|
215 |
+
### Python Patch ###
|
216 |
+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
217 |
+
poetry.toml
|
218 |
+
|
219 |
+
# ruff
|
220 |
+
.ruff_cache/
|
221 |
+
|
222 |
+
# LSP config files
|
223 |
+
pyrightconfig.json
|
224 |
+
|
225 |
+
### Windows ###
|
226 |
+
# Windows thumbnail cache files
|
227 |
+
Thumbs.db
|
228 |
+
Thumbs.db:encryptable
|
229 |
+
ehthumbs.db
|
230 |
+
ehthumbs_vista.db
|
231 |
+
|
232 |
+
# Dump file
|
233 |
+
*.stackdump
|
234 |
+
|
235 |
+
# Folder config file
|
236 |
+
[Dd]esktop.ini
|
237 |
+
|
238 |
+
# Recycle Bin used on file shares
|
239 |
+
$RECYCLE.BIN/
|
240 |
+
|
241 |
+
# Windows Installer files
|
242 |
+
*.cab
|
243 |
+
*.msi
|
244 |
+
*.msix
|
245 |
+
*.msm
|
246 |
+
*.msp
|
247 |
+
|
248 |
+
# Windows shortcuts
|
249 |
+
*.lnk
|
250 |
+
|
251 |
+
# End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux,dotenv,python
|
app.py
CHANGED
@@ -31,16 +31,6 @@ Example images by NovelAI and niji・journey.
|
|
31 |
model = SiglipForImageClassification.from_pretrained(MODEL_NAME, token=HF_TOKEN)
|
32 |
processor = AutoImageProcessor.from_pretrained(PROCESSOR_NAME, token=HF_TOKEN)
|
33 |
|
34 |
-
try:
|
35 |
-
print("torch.compile")
|
36 |
-
model = torch.compile(model)
|
37 |
-
# warmup
|
38 |
-
print("warming up...")
|
39 |
-
model(**processor(Image.open(EXAMPLES[0][0]), return_tensors="pt"))
|
40 |
-
print("done")
|
41 |
-
except:
|
42 |
-
print("torch.compile not supported")
|
43 |
-
|
44 |
|
45 |
def compose_text(results: dict[str, float], threshold: float = 0.3):
|
46 |
return ", ".join(
|
|
|
31 |
model = SiglipForImageClassification.from_pretrained(MODEL_NAME, token=HF_TOKEN)
|
32 |
processor = AutoImageProcessor.from_pretrained(PROCESSOR_NAME, token=HF_TOKEN)
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
def compose_text(results: dict[str, float], threshold: float = 0.3):
|
36 |
return ", ".join(
|