Upload search_image_by_image_or_text/pools.py with huggingface_hub
Browse files
search_image_by_image_or_text/pools.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Type
|
| 2 |
+
|
| 3 |
+
from cheesechaser.datapool import IncrementIDDataPool
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def quick_webp_pool(site_name: str, level: int = 3) -> Type[IncrementIDDataPool]:
|
| 7 |
+
repo_id = f'deepghs/{site_name}-webp-4Mpixel'
|
| 8 |
+
|
| 9 |
+
class _QuickWebpDataPool(IncrementIDDataPool):
|
| 10 |
+
def __init__(self, revision: str = 'main'):
|
| 11 |
+
IncrementIDDataPool.__init__(
|
| 12 |
+
self,
|
| 13 |
+
data_repo_id=repo_id,
|
| 14 |
+
data_revision=revision,
|
| 15 |
+
idx_repo_id=repo_id,
|
| 16 |
+
idx_revision=revision,
|
| 17 |
+
base_level=level,
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
return _QuickWebpDataPool
|