narugo commited on
Commit
3c7d8d9
1 Parent(s): e0b6f8d

dev(narugo): save project

Browse files
Files changed (3) hide show
  1. .gitignore +1227 -0
  2. app.py +137 -0
  3. requirements.txt +3 -1
.gitignore ADDED
@@ -0,0 +1,1227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Created by .ignore support plugin (hsz.mobi)
2
+ ### Example user template template
3
+ ### Example user template
4
+
5
+ # IntelliJ project files
6
+ .idea
7
+ *.iml
8
+ out
9
+ gen
10
+ ### CVS template
11
+ /CVS/*
12
+ **/CVS/*
13
+ .cvsignore
14
+ */.cvsignore
15
+
16
+ ### C++ template
17
+ # Prerequisites
18
+ *.d
19
+
20
+ # Compiled Object files
21
+ *.slo
22
+ *.lo
23
+ *.o
24
+ *.obj
25
+
26
+ # Precompiled Headers
27
+ *.gch
28
+ *.pch
29
+
30
+ # Compiled Dynamic libraries
31
+ *.so
32
+ *.dylib
33
+ *.dll
34
+
35
+ # Fortran module files
36
+ *.mod
37
+ *.smod
38
+
39
+ # Compiled Static libraries
40
+ *.lai
41
+ *.la
42
+ *.a
43
+ *.lib
44
+
45
+ # Executables
46
+ *.exe
47
+ *.out
48
+ *.app
49
+
50
+ ### CUDA template
51
+ *.i
52
+ *.ii
53
+ *.gpu
54
+ *.ptx
55
+ *.cubin
56
+ *.fatbin
57
+
58
+ ### SVN template
59
+ .svn/
60
+
61
+ ### Images template
62
+ # JPEG
63
+ *.jpe
64
+ *.jif
65
+ *.jfif
66
+ *.jfi
67
+
68
+ # JPEG 2000
69
+ *.jp2
70
+ *.j2k
71
+ *.jpf
72
+ *.jpx
73
+ *.jpm
74
+ *.mj2
75
+
76
+ # JPEG XR
77
+ *.jxr
78
+ *.hdp
79
+ *.wdp
80
+
81
+ # Graphics Interchange Format
82
+ *.gif
83
+
84
+ # RAW
85
+ *.raw
86
+
87
+ # Web P
88
+ *.webp
89
+
90
+ # Portable Network Graphics
91
+ #*.png
92
+
93
+ # Animated Portable Network Graphics
94
+ *.apng
95
+
96
+ # Multiple-image Network Graphics
97
+ *.mng
98
+
99
+ # Tagged Image File Format
100
+ *.tiff
101
+ *.tif
102
+
103
+ # Scalable Vector Graphics
104
+ *.svg
105
+ *.svgz
106
+
107
+ # Portable Document Format
108
+ *.pdf
109
+
110
+ # X BitMap
111
+ *.xbm
112
+
113
+ # BMP
114
+ *.bmp
115
+ *.dib
116
+
117
+ # ICO
118
+ *.ico
119
+
120
+ # 3D Images
121
+ *.3dm
122
+ *.max
123
+
124
+ ### Eclipse template
125
+ .metadata
126
+ bin/
127
+ tmp/
128
+ *.tmp
129
+ *.bak
130
+ *.swp
131
+ *~.nib
132
+ local.properties
133
+ .settings/
134
+ .loadpath
135
+ .recommenders
136
+
137
+ # External tool builders
138
+ .externalToolBuilders/
139
+
140
+ # Locally stored "Eclipse launch configurations"
141
+ *.launch
142
+
143
+ # PyDev specific (Python IDE for Eclipse)
144
+ *.pydevproject
145
+
146
+ # CDT-specific (C/C++ Development Tooling)
147
+ .cproject
148
+
149
+ # CDT- autotools
150
+ .autotools
151
+
152
+ # Java annotation processor (APT)
153
+ .factorypath
154
+
155
+ # PDT-specific (PHP Development Tools)
156
+ .buildpath
157
+
158
+ # sbteclipse plugin
159
+ .target
160
+
161
+ # Tern plugin
162
+ .tern-project
163
+
164
+ # TeXlipse plugin
165
+ .texlipse
166
+
167
+ # STS (Spring Tool Suite)
168
+ .springBeans
169
+
170
+ # Code Recommenders
171
+ .recommenders/
172
+
173
+ # Annotation Processing
174
+ .apt_generated/
175
+ .apt_generated_test/
176
+
177
+ # Scala IDE specific (Scala & Java development for Eclipse)
178
+ .cache-main
179
+ .scala_dependencies
180
+ .worksheet
181
+
182
+ # Uncomment this line if you wish to ignore the project description file.
183
+ # Typically, this file would be tracked if it contains build/dependency configurations:
184
+ #.project
185
+
186
+ ### Diff template
187
+ *.patch
188
+ *.diff
189
+
190
+ ### macOS template
191
+ # General
192
+ .DS_Store
193
+ .AppleDouble
194
+ .LSOverride
195
+
196
+ # Icon must end with two \r
197
+ Icon
198
+
199
+ # Thumbnails
200
+ ._*
201
+
202
+ # Files that might appear in the root of a volume
203
+ .DocumentRevisions-V100
204
+ .fseventsd
205
+ .Spotlight-V100
206
+ .TemporaryItems
207
+ .Trashes
208
+ .VolumeIcon.icns
209
+ .com.apple.timemachine.donotpresent
210
+
211
+ # Directories potentially created on remote AFP share
212
+ .AppleDB
213
+ .AppleDesktop
214
+ Network Trash Folder
215
+ Temporary Items
216
+ .apdisk
217
+
218
+ ### CMake template
219
+ CMakeLists.txt.user
220
+ CMakeCache.txt
221
+ CMakeFiles
222
+ CMakeScripts
223
+ Testing
224
+ cmake_install.cmake
225
+ install_manifest.txt
226
+ compile_commands.json
227
+ CTestTestfile.cmake
228
+ _deps
229
+
230
+ ### Linux template
231
+ *~
232
+
233
+ # temporary files which can be created if a process still has a handle open of a deleted file
234
+ .fuse_hidden*
235
+
236
+ # KDE directory preferences
237
+ .directory
238
+
239
+ # Linux trash folder which might appear on any partition or disk
240
+ .Trash-*
241
+
242
+ # .nfs files are created when an open file is removed but is still being accessed
243
+ .nfs*
244
+
245
+ ### MicrosoftOffice template
246
+ *.tmp
247
+
248
+ # Word temporary
249
+ ~$*.doc*
250
+
251
+ # Word Auto Backup File
252
+ Backup of *.doc*
253
+
254
+ # Excel temporary
255
+ ~$*.xls*
256
+
257
+ # Excel Backup File
258
+ *.xlk
259
+
260
+ # PowerPoint temporary
261
+ ~$*.ppt*
262
+
263
+ # Visio autosave temporary files
264
+ *.~vsd*
265
+
266
+ ### VisualStudio template
267
+ ## Ignore Visual Studio temporary files, build results, and
268
+ ## files generated by popular Visual Studio add-ons.
269
+ ##
270
+ ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
271
+
272
+ # User-specific files
273
+ *.rsuser
274
+ *.suo
275
+ *.user
276
+ *.userosscache
277
+ *.sln.docstates
278
+
279
+ # User-specific files (MonoDevelop/Xamarin Studio)
280
+ *.userprefs
281
+
282
+ # Mono auto generated files
283
+ mono_crash.*
284
+
285
+ # Build results
286
+ [Dd]ebug/
287
+ [Dd]ebugPublic/
288
+ [Rr]elease/
289
+ [Rr]eleases/
290
+ x64/
291
+ x86/
292
+ [Ww][Ii][Nn]32/
293
+ [Aa][Rr][Mm]/
294
+ [Aa][Rr][Mm]64/
295
+ bld/
296
+ [Bb]in/
297
+ [Oo]bj/
298
+ [Ll]og/
299
+ [Ll]ogs/
300
+
301
+ # Visual Studio 2015/2017 cache/options directory
302
+ .vs/
303
+ # Uncomment if you have tasks that create the project's static files in wwwroot
304
+ #wwwroot/
305
+
306
+ # Visual Studio 2017 auto generated files
307
+ Generated\ Files/
308
+
309
+ # MSTest test Results
310
+ [Tt]est[Rr]esult*/
311
+ [Bb]uild[Ll]og.*
312
+
313
+ # NUnit
314
+ *.VisualState.xml
315
+ TestResult.xml
316
+ nunit-*.xml
317
+
318
+ # Build Results of an ATL Project
319
+ [Dd]ebugPS/
320
+ [Rr]eleasePS/
321
+ dlldata.c
322
+
323
+ # Benchmark Results
324
+ BenchmarkDotNet.Artifacts/
325
+
326
+ # .NET Core
327
+ project.lock.json
328
+ project.fragment.lock.json
329
+ artifacts/
330
+
331
+ # ASP.NET Scaffolding
332
+ ScaffoldingReadMe.txt
333
+
334
+ # StyleCop
335
+ StyleCopReport.xml
336
+
337
+ # Files built by Visual Studio
338
+ *_i.c
339
+ *_p.c
340
+ *_h.h
341
+ *.ilk
342
+ *.meta
343
+ *.obj
344
+ *.iobj
345
+ *.pch
346
+ *.pdb
347
+ *.ipdb
348
+ *.pgc
349
+ *.pgd
350
+ *.rsp
351
+ *.sbr
352
+ *.tlb
353
+ *.tli
354
+ *.tlh
355
+ *.tmp
356
+ *.tmp_proj
357
+ *_wpftmp.csproj
358
+ *.log
359
+ *.vspscc
360
+ *.vssscc
361
+ .builds
362
+ *.pidb
363
+ *.svclog
364
+ *.scc
365
+
366
+ # Chutzpah Test files
367
+ _Chutzpah*
368
+
369
+ # Visual C++ cache files
370
+ ipch/
371
+ *.aps
372
+ *.ncb
373
+ *.opendb
374
+ *.opensdf
375
+ *.sdf
376
+ *.cachefile
377
+ *.VC.db
378
+ *.VC.VC.opendb
379
+
380
+ # Visual Studio profiler
381
+ *.psess
382
+ *.vsp
383
+ *.vspx
384
+ *.sap
385
+
386
+ # Visual Studio Trace Files
387
+ *.e2e
388
+
389
+ # TFS 2012 Local Workspace
390
+ $tf/
391
+
392
+ # Guidance Automation Toolkit
393
+ *.gpState
394
+
395
+ # ReSharper is a .NET coding add-in
396
+ _ReSharper*/
397
+ *.[Rr]e[Ss]harper
398
+ *.DotSettings.user
399
+
400
+ # TeamCity is a build add-in
401
+ _TeamCity*
402
+
403
+ # DotCover is a Code Coverage Tool
404
+ *.dotCover
405
+
406
+ # AxoCover is a Code Coverage Tool
407
+ .axoCover/*
408
+ !.axoCover/settings.json
409
+
410
+ # Coverlet is a free, cross platform Code Coverage Tool
411
+ coverage*.json
412
+ coverage*.xml
413
+ coverage*.info
414
+
415
+ # Visual Studio code coverage results
416
+ *.coverage
417
+ *.coveragexml
418
+
419
+ # NCrunch
420
+ _NCrunch_*
421
+ .*crunch*.local.xml
422
+ nCrunchTemp_*
423
+
424
+ # MightyMoose
425
+ *.mm.*
426
+ AutoTest.Net/
427
+
428
+ # Web workbench (sass)
429
+ .sass-cache/
430
+
431
+ # Installshield output folder
432
+ [Ee]xpress/
433
+
434
+ # DocProject is a documentation generator add-in
435
+ DocProject/buildhelp/
436
+ DocProject/Help/*.HxT
437
+ DocProject/Help/*.HxC
438
+ DocProject/Help/*.hhc
439
+ DocProject/Help/*.hhk
440
+ DocProject/Help/*.hhp
441
+ DocProject/Help/Html2
442
+ DocProject/Help/html
443
+
444
+ # Click-Once directory
445
+ publish/
446
+
447
+ # Publish Web Output
448
+ *.[Pp]ublish.xml
449
+ *.azurePubxml
450
+ # Note: Comment the next line if you want to checkin your web deploy settings,
451
+ # but database connection strings (with potential passwords) will be unencrypted
452
+ *.pubxml
453
+ *.publishproj
454
+
455
+ # Microsoft Azure Web App publish settings. Comment the next line if you want to
456
+ # checkin your Azure Web App publish settings, but sensitive information contained
457
+ # in these scripts will be unencrypted
458
+ PublishScripts/
459
+
460
+ # NuGet Packages
461
+ *.nupkg
462
+ # NuGet Symbol Packages
463
+ *.snupkg
464
+ # The packages folder can be ignored because of Package Restore
465
+ **/[Pp]ackages/*
466
+ # except build/, which is used as an MSBuild target.
467
+ !**/[Pp]ackages/build/
468
+ # Uncomment if necessary however generally it will be regenerated when needed
469
+ #!**/[Pp]ackages/repositories.config
470
+ # NuGet v3's project.json files produces more ignorable files
471
+ *.nuget.props
472
+ *.nuget.targets
473
+
474
+ # Microsoft Azure Build Output
475
+ csx/
476
+ *.build.csdef
477
+
478
+ # Microsoft Azure Emulator
479
+ ecf/
480
+ rcf/
481
+
482
+ # Windows Store app package directories and files
483
+ AppPackages/
484
+ BundleArtifacts/
485
+ Package.StoreAssociation.xml
486
+ _pkginfo.txt
487
+ *.appx
488
+ *.appxbundle
489
+ *.appxupload
490
+
491
+ # Visual Studio cache files
492
+ # files ending in .cache can be ignored
493
+ *.[Cc]ache
494
+ # but keep track of directories ending in .cache
495
+ !?*.[Cc]ache/
496
+
497
+ # Others
498
+ ClientBin/
499
+ ~$*
500
+ *~
501
+ *.dbmdl
502
+ *.dbproj.schemaview
503
+ *.jfm
504
+ *.pfx
505
+ *.publishsettings
506
+ orleans.codegen.cs
507
+
508
+ # Including strong name files can present a security risk
509
+ # (https://github.com/github/gitignore/pull/2483#issue-259490424)
510
+ #*.snk
511
+
512
+ # Since there are multiple workflows, uncomment next line to ignore bower_components
513
+ # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
514
+ #bower_components/
515
+
516
+ # RIA/Silverlight projects
517
+ Generated_Code/
518
+
519
+ # Backup & report files from converting an old project file
520
+ # to a newer Visual Studio version. Backup files are not needed,
521
+ # because we have git ;-)
522
+ _UpgradeReport_Files/
523
+ Backup*/
524
+ UpgradeLog*.XML
525
+ UpgradeLog*.htm
526
+ ServiceFabricBackup/
527
+ *.rptproj.bak
528
+
529
+ # SQL Server files
530
+ *.mdf
531
+ *.ldf
532
+ *.ndf
533
+
534
+ # Business Intelligence projects
535
+ *.rdl.data
536
+ *.bim.layout
537
+ *.bim_*.settings
538
+ *.rptproj.rsuser
539
+ *- [Bb]ackup.rdl
540
+ *- [Bb]ackup ([0-9]).rdl
541
+ *- [Bb]ackup ([0-9][0-9]).rdl
542
+
543
+ # Microsoft Fakes
544
+ FakesAssemblies/
545
+
546
+ # GhostDoc plugin setting file
547
+ *.GhostDoc.xml
548
+
549
+ # Node.js Tools for Visual Studio
550
+ .ntvs_analysis.dat
551
+ node_modules/
552
+
553
+ # Visual Studio 6 build log
554
+ *.plg
555
+
556
+ # Visual Studio 6 workspace options file
557
+ *.opt
558
+
559
+ # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
560
+ *.vbw
561
+
562
+ # Visual Studio LightSwitch build output
563
+ **/*.HTMLClient/GeneratedArtifacts
564
+ **/*.DesktopClient/GeneratedArtifacts
565
+ **/*.DesktopClient/ModelManifest.xml
566
+ **/*.Server/GeneratedArtifacts
567
+ **/*.Server/ModelManifest.xml
568
+ _Pvt_Extensions
569
+
570
+ # Paket dependency manager
571
+ .paket/paket.exe
572
+ paket-files/
573
+
574
+ # FAKE - F# Make
575
+ .fake/
576
+
577
+ # CodeRush personal settings
578
+ .cr/personal
579
+
580
+ # Python Tools for Visual Studio (PTVS)
581
+ __pycache__/
582
+ *.pyc
583
+
584
+ # Cake - Uncomment if you are using it
585
+ # tools/**
586
+ # !tools/packages.config
587
+
588
+ # Tabs Studio
589
+ *.tss
590
+
591
+ # Telerik's JustMock configuration file
592
+ *.jmconfig
593
+
594
+ # BizTalk build output
595
+ *.btp.cs
596
+ *.btm.cs
597
+ *.odx.cs
598
+ *.xsd.cs
599
+
600
+ # OpenCover UI analysis results
601
+ OpenCover/
602
+
603
+ # Azure Stream Analytics local run output
604
+ ASALocalRun/
605
+
606
+ # MSBuild Binary and Structured Log
607
+ *.binlog
608
+
609
+ # NVidia Nsight GPU debugger configuration file
610
+ *.nvuser
611
+
612
+ # MFractors (Xamarin productivity tool) working folder
613
+ .mfractor/
614
+
615
+ # Local History for Visual Studio
616
+ .localhistory/
617
+
618
+ # BeatPulse healthcheck temp database
619
+ healthchecksdb
620
+
621
+ # Backup folder for Package Reference Convert tool in Visual Studio 2017
622
+ MigrationBackup/
623
+
624
+ # Ionide (cross platform F# VS Code tools) working folder
625
+ .ionide/
626
+
627
+ # Fody - auto-generated XML schema
628
+ FodyWeavers.xsd
629
+
630
+ ### Vim template
631
+ # Swap
632
+ [._]*.s[a-v][a-z]
633
+ !*.svg # comment out if you don't need vector files
634
+ [._]*.sw[a-p]
635
+ [._]s[a-rt-v][a-z]
636
+ [._]ss[a-gi-z]
637
+ [._]sw[a-p]
638
+
639
+ # Session
640
+ Session.vim
641
+ Sessionx.vim
642
+
643
+ # Temporary
644
+ .netrwhist
645
+ *~
646
+ # Auto-generated tag files
647
+ tags
648
+ # Persistent undo
649
+ [._]*.un~
650
+
651
+ ### Backup template
652
+ *.bak
653
+ *.gho
654
+ *.ori
655
+ *.orig
656
+ *.tmp
657
+
658
+ ### SublimeText template
659
+ # Cache files for Sublime Text
660
+ *.tmlanguage.cache
661
+ *.tmPreferences.cache
662
+ *.stTheme.cache
663
+
664
+ # Workspace files are user-specific
665
+ *.sublime-workspace
666
+
667
+ # Project files should be checked into the repository, unless a significant
668
+ # proportion of contributors will probably not be using Sublime Text
669
+ # *.sublime-project
670
+
671
+ # SFTP configuration file
672
+ sftp-config.json
673
+ sftp-config-alt*.json
674
+
675
+ # Package control specific files
676
+ Package Control.last-run
677
+ Package Control.ca-list
678
+ Package Control.ca-bundle
679
+ Package Control.system-ca-bundle
680
+ Package Control.cache/
681
+ Package Control.ca-certs/
682
+ Package Control.merged-ca-bundle
683
+ Package Control.user-ca-bundle
684
+ oscrypto-ca-bundle.crt
685
+ bh_unicode_properties.cache
686
+
687
+ # Sublime-github package stores a github token in this file
688
+ # https://packagecontrol.io/packages/sublime-github
689
+ GitHub.sublime-settings
690
+
691
+ ### C template
692
+ # Prerequisites
693
+ *.d
694
+
695
+ # Object files
696
+ *.o
697
+ *.ko
698
+ *.obj
699
+ *.elf
700
+
701
+ # Linker output
702
+ *.ilk
703
+ *.map
704
+ *.exp
705
+
706
+ # Precompiled Headers
707
+ *.gch
708
+ *.pch
709
+
710
+ # Libraries
711
+ *.lib
712
+ *.a
713
+ *.la
714
+ *.lo
715
+
716
+ # Shared objects (inc. Windows DLLs)
717
+ *.dll
718
+ *.so
719
+ *.so.*
720
+ *.dylib
721
+
722
+ # Executables
723
+ *.exe
724
+ *.out
725
+ *.app
726
+ *.i*86
727
+ *.x86_64
728
+ *.hex
729
+
730
+ # Debug files
731
+ *.dSYM/
732
+ *.su
733
+ *.idb
734
+ *.pdb
735
+
736
+ # Kernel Module Compile Results
737
+ *.mod*
738
+ *.cmd
739
+ .tmp_versions/
740
+ modules.order
741
+ Module.symvers
742
+ Mkfile.old
743
+ dkms.conf
744
+
745
+ ### VirtualEnv template
746
+ # Virtualenv
747
+ # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
748
+ .Python
749
+ [Bb]in
750
+ [Ii]nclude
751
+ [Ll]ib
752
+ [Ll]ib64
753
+ [Ll]ocal
754
+ [Ss]cripts
755
+ pyvenv.cfg
756
+ .venv
757
+ pip-selfcheck.json
758
+
759
+ ### LibreOffice template
760
+ # LibreOffice locks
761
+ .~lock.*#
762
+
763
+ ### Xilinx template
764
+ # gitignore template for Xilinx Vivado Design Suite
765
+ # website: https://www.xilinx.com/support/download.html
766
+
767
+ # [home]
768
+ *.jou
769
+ *.log
770
+ *.debug
771
+ *.str
772
+ *.tmp
773
+ *.os
774
+ *.js
775
+ *.pb
776
+ *.dcp
777
+ *.hwdef
778
+ *.vds
779
+ *.veo
780
+ *.wdf
781
+ *.vdi
782
+ *.dmp
783
+ *.rpx
784
+ *.rpt
785
+ *_stub.v
786
+ *_stub.vhdl
787
+ *_funcsim.v
788
+ *_funcsim.vhdl
789
+ .project
790
+
791
+ # [dir]
792
+ *.cache
793
+ .metadata
794
+ *.data
795
+ *.ipdefs
796
+ .Xil
797
+ *.sdk
798
+ *.hw
799
+ *.ip_user_files
800
+
801
+ ### IP synth
802
+ *_synth_*
803
+
804
+ .jobs
805
+
806
+ ### project synth
807
+ */*.runs/synth*/*.xml
808
+ */*.runs/synth*/*.txt
809
+ */*.runs/synth*/*.sh
810
+ */*.runs/synth*/*.tcl
811
+ */*.runs/synth*/*.bat
812
+ */*.runs/synth*/*.xdc
813
+ !*/*.runs/synth*/*utilization*.rpt
814
+
815
+ *.runs/synth*/*.xml
816
+ *.runs/synth*/*.txt
817
+ *.runs/synth*/*.sh
818
+ *.runs/synth*/*.tcl
819
+ *.runs/synth*/*.bat
820
+ *.runs/synth*/*.xdc
821
+ !*.runs/synth*/*utilization*.rpt
822
+
823
+ ### project impl
824
+ */*.runs/impl*/*.xml
825
+ */*.runs/impl*/*.html
826
+ */*.runs/impl*/*.txt
827
+ */*.runs/impl*/*.sh
828
+ */*.runs/impl*/*.tcl
829
+ */*.runs/impl*/*.bat
830
+ !*/*.runs/impl*/*utilization*.rpt
831
+
832
+ *.runs/impl*/*.xml
833
+ *.runs/impl*/*.html
834
+ *.runs/impl*/*.txt
835
+ *.runs/impl*/*.sh
836
+ *.runs/impl*/*.tcl
837
+ *.runs/impl*/*.bat
838
+ !*.runs/impl*/*utilization*.rpt
839
+
840
+ ### block design
841
+ */*/bd/*/hdl
842
+ */*/*/bd/*/hdl
843
+
844
+ */*/bd/*/*.xdc
845
+ */*/*/bd/*/*.xdc
846
+
847
+ */*/bd/*/ip/*/*.xdc
848
+ */*/*/bd/*/ip/*/*.xdc
849
+
850
+ */*/bd/*/ip/*/*/
851
+ */*/*/bd/*/ip/*/*/
852
+
853
+ */*/bd/*/ip/*/*.vhd
854
+ */*/*/bd/*/ip/*/*.vhd
855
+
856
+ */*/bd/*/ip/*/*.xml
857
+ */*/*/bd/*/ip/*/*.xml
858
+
859
+ *.c
860
+ *.cpp
861
+ *.h
862
+ *.vho
863
+ */*/bd/*/ip/*/*.tcl
864
+ */*/*/bd/*/ip/*/*.tcl
865
+ hw_handoff
866
+ ipshared
867
+
868
+ ### Lua template
869
+ # Compiled Lua sources
870
+ luac.out
871
+
872
+ # luarocks build files
873
+ *.src.rock
874
+ *.zip
875
+
876
+ # Object files
877
+ *.o
878
+ *.os
879
+ *.ko
880
+ *.obj
881
+ *.elf
882
+
883
+ # Precompiled Headers
884
+ *.gch
885
+ *.pch
886
+
887
+ # Libraries
888
+ *.lib
889
+ *.a
890
+ *.la
891
+ *.lo
892
+ *.def
893
+ *.exp
894
+
895
+ # Shared objects (inc. Windows DLLs)
896
+ *.dll
897
+ *.so
898
+ *.so.*
899
+ *.dylib
900
+
901
+ # Executables
902
+ *.exe
903
+ *.out
904
+ *.app
905
+ *.i*86
906
+ *.x86_64
907
+ *.hex
908
+
909
+
910
+ ### Vagrant template
911
+ # General
912
+ .vagrant/
913
+
914
+ # Log files (if you are creating logs in debug mode, uncomment this)
915
+ # *.log
916
+
917
+ ### PuTTY template
918
+ # Private key
919
+ *.ppk
920
+
921
+ ### Patch template
922
+ *.orig
923
+ *.rej
924
+
925
+ ### Python template
926
+ # Byte-compiled / optimized / DLL files
927
+ __pycache__/
928
+ *.py[cod]
929
+ *$py.class
930
+
931
+ # C extensions
932
+ *.so
933
+
934
+ # Distribution / packaging
935
+ .Python
936
+ build/
937
+ develop-eggs/
938
+ /dist
939
+ wheelhouse/
940
+ downloads/
941
+ eggs/
942
+ .eggs/
943
+ lib/
944
+ lib64/
945
+ parts/
946
+ sdist/
947
+ var/
948
+ wheels/
949
+ share/python-wheels/
950
+ *.egg-info/
951
+ .installed.cfg
952
+ *.egg
953
+ MANIFEST
954
+
955
+ # PyInstaller
956
+ # Usually these files are written by a python script from a template
957
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
958
+ *.manifest
959
+ *.spec
960
+
961
+ # Installer logs
962
+ pip-log.txt
963
+ pip-delete-this-directory.txt
964
+
965
+ # Unit test / coverage reports
966
+ htmlcov/
967
+ .tox/
968
+ .nox/
969
+ .coverage
970
+ .coverage.*
971
+ .cache
972
+ nosetests.xml
973
+ coverage.xml
974
+ *.cover
975
+ *.py,cover
976
+ .hypothesis/
977
+ .pytest_cache/
978
+ cover/
979
+
980
+ # Translations
981
+ *.mo
982
+ *.pot
983
+
984
+ # Django stuff:
985
+ *.log
986
+ local_settings.py
987
+ db.sqlite3
988
+ db.sqlite3-journal
989
+
990
+ # Flask stuff:
991
+ instance/
992
+ .webassets-cache
993
+
994
+ # Scrapy stuff:
995
+ .scrapy
996
+
997
+ # Sphinx documentation
998
+ docs/_build/
999
+
1000
+ # PyBuilder
1001
+ .pybuilder/
1002
+ target/
1003
+
1004
+ # Jupyter Notebook
1005
+ .ipynb_checkpoints
1006
+
1007
+ # IPython
1008
+ profile_default/
1009
+ ipython_config.py
1010
+
1011
+ # pyenv
1012
+ # For a library or package, you might want to ignore these files since the code is
1013
+ # intended to run in multiple environments; otherwise, check them in:
1014
+ # .python-version
1015
+
1016
+ # pipenv
1017
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
1018
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
1019
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
1020
+ # install all needed dependencies.
1021
+ #Pipfile.lock
1022
+
1023
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
1024
+ __pypackages__/
1025
+
1026
+ # Celery stuff
1027
+ celerybeat-schedule
1028
+ celerybeat.pid
1029
+
1030
+ # SageMath parsed files
1031
+ *.sage.py
1032
+
1033
+ # Environments
1034
+ .env
1035
+ .venv
1036
+ /env/
1037
+ venv/
1038
+ ENV/
1039
+ env.bak/
1040
+ venv.bak/
1041
+
1042
+ # Spyder project settings
1043
+ .spyderproject
1044
+ .spyproject
1045
+
1046
+ # Rope project settings
1047
+ .ropeproject
1048
+
1049
+ # mkdocs documentation
1050
+ /site
1051
+
1052
+ # mypy
1053
+ .mypy_cache/
1054
+ .dmypy.json
1055
+ dmypy.json
1056
+
1057
+ # Pyre type checker
1058
+ .pyre/
1059
+
1060
+ # pytype static type analyzer
1061
+ .pytype/
1062
+
1063
+ # Cython debug symbols
1064
+ cython_debug/
1065
+
1066
+ ### Windows template
1067
+ # Windows thumbnail cache files
1068
+ Thumbs.db
1069
+ Thumbs.db:encryptable
1070
+ ehthumbs.db
1071
+ ehthumbs_vista.db
1072
+
1073
+ # Dump file
1074
+ *.stackdump
1075
+
1076
+ # Folder config file
1077
+ [Dd]esktop.ini
1078
+
1079
+ # Recycle Bin used on file shares
1080
+ $RECYCLE.BIN/
1081
+
1082
+ # Windows Installer files
1083
+ *.cab
1084
+ *.msi
1085
+ *.msix
1086
+ *.msm
1087
+ *.msp
1088
+
1089
+ # Windows shortcuts
1090
+ *.lnk
1091
+
1092
+ ### Xcode template
1093
+ # Xcode
1094
+ #
1095
+ # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
1096
+
1097
+ ## User settings
1098
+ xcuserdata/
1099
+
1100
+ ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
1101
+ *.xcscmblueprint
1102
+ *.xccheckout
1103
+
1104
+ ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
1105
+ build/
1106
+ DerivedData/
1107
+ *.moved-aside
1108
+ *.pbxuser
1109
+ !default.pbxuser
1110
+ *.mode1v3
1111
+ !default.mode1v3
1112
+ *.mode2v3
1113
+ !default.mode2v3
1114
+ *.perspectivev3
1115
+ !default.perspectivev3
1116
+
1117
+ ## Gcc Patch
1118
+ /*.gcno
1119
+
1120
+ ### JetBrains template
1121
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
1122
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
1123
+
1124
+ # User-specific stuff
1125
+ .idea/**/workspace.xml
1126
+ .idea/**/tasks.xml
1127
+ .idea/**/usage.statistics.xml
1128
+ .idea/**/dictionaries
1129
+ .idea/**/shelf
1130
+
1131
+ # Generated files
1132
+ .idea/**/contentModel.xml
1133
+
1134
+ # Sensitive or high-churn files
1135
+ .idea/**/dataSources/
1136
+ .idea/**/dataSources.ids
1137
+ .idea/**/dataSources.local.xml
1138
+ .idea/**/sqlDataSources.xml
1139
+ .idea/**/dynamic.xml
1140
+ .idea/**/uiDesigner.xml
1141
+ .idea/**/dbnavigator.xml
1142
+
1143
+ # Gradle
1144
+ .idea/**/gradle.xml
1145
+ .idea/**/libraries
1146
+
1147
+ # Gradle and Maven with auto-import
1148
+ # When using Gradle or Maven with auto-import, you should exclude module files,
1149
+ # since they will be recreated, and may cause churn. Uncomment if using
1150
+ # auto-import.
1151
+ # .idea/artifacts
1152
+ # .idea/compiler.xml
1153
+ # .idea/jarRepositories.xml
1154
+ # .idea/modules.xml
1155
+ # .idea/*.iml
1156
+ # .idea/modules
1157
+ # *.iml
1158
+ # *.ipr
1159
+
1160
+ # CMake
1161
+ cmake-build-*/
1162
+
1163
+ # Mongo Explorer plugin
1164
+ .idea/**/mongoSettings.xml
1165
+
1166
+ # File-based project format
1167
+ *.iws
1168
+
1169
+ # IntelliJ
1170
+ out/
1171
+
1172
+ # mpeltonen/sbt-idea plugin
1173
+ .idea_modules/
1174
+
1175
+ # JIRA plugin
1176
+ atlassian-ide-plugin.xml
1177
+
1178
+ # Cursive Clojure plugin
1179
+ .idea/replstate.xml
1180
+
1181
+ # Crashlytics plugin (for Android Studio and IntelliJ)
1182
+ com_crashlytics_export_strings.xml
1183
+ crashlytics.properties
1184
+ crashlytics-build.properties
1185
+ fabric.properties
1186
+
1187
+ # Editor-based Rest Client
1188
+ .idea/httpRequests
1189
+
1190
+ # Android studio 3.1+ serialized cache file
1191
+ .idea/caches/build_file_checksums.ser
1192
+
1193
+ /test_*
1194
+ .python-version
1195
+ /docs/build
1196
+ /public
1197
+ /docs/source/**/*.puml.svg
1198
+ /docs/source/**/*.puml.png
1199
+ /docs/source/**/*.gv.svg
1200
+ /docs/source/**/*.gv.png
1201
+ /docs/source/**/*.py.txt
1202
+ /docs/source/**/*.py.err
1203
+ /docs/source/**/*.py.exitcode
1204
+ /docs/source/**/*.sh.txt
1205
+ /docs/source/**/*.sh.err
1206
+ /docs/source/**/*.sh.exitcode
1207
+ /docs/source/**/*.dat.*
1208
+ !/docs/source/**/*.plot.py.svg
1209
+ !/docs/source/_static/**/*
1210
+ /docs/source/**/*.result.ipynb
1211
+ /cartpole_dqn_*
1212
+ /hfutils/**/*.json
1213
+ /hfutils/**/*.yaml
1214
+ /hfutils/**/*.yml
1215
+ /extra
1216
+ /resource/yolort/*
1217
+ !/resource/yolort/Makefile
1218
+ !/test/testfile/**/*
1219
+ !/zoo/testfile/**/*
1220
+ /test/testfile/dataset
1221
+ /zoo/testfile/dataset
1222
+ /.train
1223
+ *.pt
1224
+ /runs
1225
+ /YOLOv8
1226
+ .benchmarks
1227
+ !/hfutils/utils/irregular_repo.json
app.py ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+ from functools import lru_cache
4
+ from typing import List, Dict
5
+
6
+ import faiss
7
+ import gradio as gr
8
+ import numpy as np
9
+ from PIL import Image
10
+ from cheesechaser.datapool import DanbooruWebpDataPool
11
+ from hfutils.operate import get_hf_fs, get_hf_client
12
+ from hfutils.utils import TemporaryDirectory
13
+ from imgutils.tagging import wd14
14
+
15
+ _REPO_ID = 'deepghs/index_experiments'
16
+
17
+ hf_fs = get_hf_fs()
18
+ hf_client = get_hf_client()
19
+
20
+ _DEFAULT_MODEL_NAME = 'SwinV2_v3_danbooru_7001436_4GB'
21
+ _ALL_MODEL_NAMES = [
22
+ os.path.dirname(os.path.relpath(path, _REPO_ID))
23
+ for path in hf_fs.glob(f'{_REPO_ID}/*/knn.index')
24
+ ]
25
+
26
+
27
+ def _get_from_ids(ids: List[int]) -> Dict[int, Image.Image]:
28
+ with TemporaryDirectory() as td:
29
+ datapool = DanbooruWebpDataPool()
30
+ datapool.batch_download_to_directory(
31
+ resource_ids=ids,
32
+ dst_dir=td,
33
+ )
34
+
35
+ retval = {}
36
+ for file in os.listdir(td):
37
+ id_ = int(os.path.splitext(file)[0])
38
+ image = Image.open(os.path.join(td, file))
39
+ image.load()
40
+ retval[id_] = image
41
+
42
+ return retval
43
+
44
+
45
+ def _x(x):
46
+ if isinstance(x, (int, np.integer)):
47
+ return int(x)
48
+ elif isinstance(x, (str, np.str_)):
49
+ return int(str(x).split('_')[-1])
50
+ else:
51
+ raise ValueError(f'Invalid ID: {x!r}, type: {type(x)!r}')
52
+
53
+
54
+ @lru_cache(maxsize=3)
55
+ def _get_index_info(repo_id: str, model_name: str):
56
+ image_ids = np.load(hf_client.hf_hub_download(
57
+ repo_id=repo_id,
58
+ repo_type='model',
59
+ filename=f'{model_name}/ids.npy',
60
+ ))
61
+ knn_index = faiss.read_index(hf_client.hf_hub_download(
62
+ repo_id=repo_id,
63
+ repo_type='model',
64
+ filename=f'{model_name}/knn.index',
65
+ ))
66
+
67
+ config = json.loads(open(hf_client.hf_hub_download(
68
+ repo_id=repo_id,
69
+ repo_type='model',
70
+ filename=f'{model_name}/infos.json',
71
+ )).read())["index_param"]
72
+ faiss.ParameterSpace().set_index_parameters(knn_index, config)
73
+ return image_ids, knn_index
74
+
75
+
76
+ def search(model_name: str, img_input, n_neighbours: int):
77
+ images_ids, knn_index = _get_index_info(_REPO_ID, model_name)
78
+ embeddings = wd14.get_wd14_tags(
79
+ img_input,
80
+ model_name="SwinV2_v3",
81
+ fmt="embedding",
82
+ )
83
+ embeddings = np.expand_dims(embeddings, 0)
84
+ faiss.normalize_L2(embeddings)
85
+
86
+ dists, indexes = knn_index.search(embeddings, k=n_neighbours)
87
+ neighbours_ids = images_ids[indexes][0]
88
+ neighbours_ids = [_x(x) for x in neighbours_ids]
89
+
90
+ captions = []
91
+ images = []
92
+ ids_to_images = _get_from_ids(neighbours_ids)
93
+ for image_id, dist in zip(neighbours_ids, dists[0]):
94
+ if image_id in ids_to_images:
95
+ images.append(ids_to_images[image_id])
96
+ captions.append(f"{image_id}/{dist:.2f}")
97
+
98
+ return list(zip(images, captions))
99
+
100
+
101
+ if __name__ == "__main__":
102
+ with gr.Blocks() as demo:
103
+ with gr.Row():
104
+ with gr.Column():
105
+ img_input = gr.Image(type="pil", label="Input")
106
+
107
+ with gr.Column():
108
+ with gr.Row():
109
+ n_model = gr.Dropdown(
110
+ choices=_ALL_MODEL_NAMES,
111
+ value=_DEFAULT_MODEL_NAME,
112
+ label='Index to Use',
113
+ )
114
+ with gr.Row():
115
+ n_neighbours = gr.Slider(
116
+ minimum=1,
117
+ maximum=50,
118
+ value=20,
119
+ step=1,
120
+ label="# of images",
121
+ )
122
+ find_btn = gr.Button("Find similar images")
123
+
124
+ with gr.Row():
125
+ similar_images = gr.Gallery(label="Similar images", columns=[5])
126
+
127
+ find_btn.click(
128
+ fn=search,
129
+ inputs=[
130
+ n_model,
131
+ img_input,
132
+ n_neighbours,
133
+ ],
134
+ outputs=[similar_images],
135
+ )
136
+
137
+ demo.queue().launch()
requirements.txt CHANGED
@@ -1,4 +1,6 @@
1
  pillow>=9.0.0
2
  faiss-cpu
3
  dghs-imgutils
4
- onnxruntime
 
 
 
1
  pillow>=9.0.0
2
  faiss-cpu
3
  dghs-imgutils
4
+ onnxruntime
5
+ gradio==5.5.0
6
+ cheesechaser