narugo commited on
Commit
8537a9b
·
1 Parent(s): 84a3dfc

dev(narugo): add aibooru

Browse files
Files changed (2) hide show
  1. app.py +3 -0
  2. pools.py +15 -0
app.py CHANGED
@@ -14,6 +14,8 @@ from hfutils.operate import get_hf_fs, get_hf_client
14
  from hfutils.utils import TemporaryDirectory
15
  from imgutils.tagging import wd14
16
 
 
 
17
  _REPO_ID = 'deepghs/index_experiments'
18
 
19
  hf_fs = get_hf_fs()
@@ -33,6 +35,7 @@ _SITE_CLS = {
33
  'konachan': KonachanWebpDataPool,
34
  'anime_pictures': AnimePicturesWebpDataPool,
35
  'rule34': Rule34WebpDataPool,
 
36
  }
37
 
38
 
 
14
  from hfutils.utils import TemporaryDirectory
15
  from imgutils.tagging import wd14
16
 
17
+ from pools import AIBooruWebpDataPool
18
+
19
  _REPO_ID = 'deepghs/index_experiments'
20
 
21
  hf_fs = get_hf_fs()
 
35
  'konachan': KonachanWebpDataPool,
36
  'anime_pictures': AnimePicturesWebpDataPool,
37
  'rule34': Rule34WebpDataPool,
38
+ 'aibooru': AIBooruWebpDataPool,
39
  }
40
 
41
 
pools.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from cheesechaser.datapool import IncrementIDDataPool
2
+
3
+ _AIBOORU_REPO_ID = 'deepghs/aibooru-webp-4Mpixel'
4
+
5
+
6
+ class AIBooruWebpDataPool(IncrementIDDataPool):
7
+ def __init__(self, revision: str = 'main'):
8
+ IncrementIDDataPool.__init__(
9
+ self,
10
+ data_repo_id=_AIBOORU_REPO_ID,
11
+ data_revision=revision,
12
+ idx_repo_id=_AIBOORU_REPO_ID,
13
+ idx_revision=revision,
14
+ base_level=3,
15
+ )