ð€ããŒã¿ã»ããã䜿ã£ãç»åæ€çŽ¢
'ð€ç»åæ€çŽ¢ã«ããŒã¿ã»ãããå©çš'
ð€ datasets
ã¯ãããŒã¿ã»ããã«ç°¡åã«ã¢ã¯ã»ã¹ããŠå
±æããããšãã§ããã©ã€ãã©ãªã§ãããŸããã¡ã¢ãªã«åãŸããªãããŒã¿ãå¹ççã«åŠçããããšã容æã«ããŸãã
datasets
ãæåã«ãªãªãŒã¹ãããåœåã¯ãäž»ã«ããã¹ãããŒã¿ãšé¢é£ããŠããŸãããããããæè¿ã§ã¯ãdatasets
ã¯é³å£°ãç»åã«å¯ŸãããµããŒããå¢ãããŠããŸããç¹ã«ãç»åã®ããã®datasets
ã®æ©èœã¿ã€ããè¿œå ãããŸããã以åã®ããã°æçš¿ã§ã¯ãdatasets
ãšð€ transformers
ãçµã¿åãããŠç»ååé¡ã¢ãã«ã®ãã¬ãŒãã³ã°æ¹æ³ã玹ä»ããŸããããã®ããã°æçš¿ã§ã¯ãdatasets
ãšä»ã®ããã€ãã®ã©ã€ãã©ãªãçµã¿åãããŠç»åæ€çŽ¢ã¢ããªã±ãŒã·ã§ã³ãäœæããæ¹æ³ãèŠãŠãããŸãã
ãŸããdatasets
ãã€ã³ã¹ããŒã«ããŸããç»åãæ±ãããã«ãpillow
ãã€ã³ã¹ããŒã«ããŸããããã«ãsentence_transformers
ãšfaiss
ãå¿
èŠã§ãããããã«ã€ããŠã¯åŸã»ã©è©³ãã説æããŸãããŸããrich
ãã€ã³ã¹ããŒã«ããŸããããã§ã¯ç°¡åã«äœ¿çšããã ãã§ãããéåžžã«äŸ¿å©ãªããã±ãŒãžãªã®ã§ããã²è©³ããæ¢çŽ¢ããŠã¿ãŠãã ããïŒ
- ã«ã¹ã¿ã ããŒã¿ã»ããã§ã»ãã³ãã£ãã¯ã»ã°ã¡ã³ããŒã·ã§ã³ã¢ãã«ã埮調æŽãã
- PyTorchå®å šã«ã·ã£ãŒãã£ã³ã°ãããããŒã¿ãã©ã¬ã«ã䜿çšããŠã倧èŠæš¡ã¢ãã«ã®ãã¬ãŒãã³ã°ãå éãã
- å®éã®ããŒã¿ãªãã§å¹ççãªããŒãã«ã®äºååŠç¿ïŒTAPEXãžã®å°å ¥
!pip install datasets pillow rich faiss-gpu sentence_transformers
ãŸãã¯ãç»åã®ç¹åŸŽãèŠãŠã¿ãŸããããçŽ æŽãããã©ã€ãã©ãªã§ããrichã䜿çšããŠãPythonãªããžã§ã¯ãïŒé¢æ°ãã¯ã©ã¹ãªã©ïŒã調ã¹ãããšãã§ããŸãã
from rich import inspect
import datasets
inspect(datasets.Image, help=True)
ââââââââââââââââââââââââââ <class 'datasets.features.image.Image'> ââââââââââââââââââââââââââ®
â class Image(decode: bool = True, id: Union[str, NoneType] = None) -> None: â
â â
â ç»åãã¡ã€ã«ããç»åããŒã¿ãèªã¿èŸŒãããã®ç»åç¹åŸŽã§ãã â
â â
â å
¥åïŒç»åç¹åŸŽã¯ä»¥äžã®å
¥åãåãä»ããŸãïŒ â
â - :obj:`str`ïŒç»åãã¡ã€ã«ãžã®çµ¶å¯Ÿãã¹ïŒã©ã³ãã ã¢ã¯ã»ã¹ãèš±å¯ãããŠããŸãïŒã â
â - ããŒãæ〠:obj:`dict`ïŒ â
â â
â - pathïŒã¢ãŒã«ã€ããã¡ã€ã«ãžã®ç»åãã¡ã€ã«ã®çžå¯Ÿãã¹ã瀺ãæååã â
â - bytesïŒç»åãã¡ã€ã«ã®ãã€ãåã â
â â
â ããã¯é 次ã¢ã¯ã»ã¹ãå¿
èŠãªã¢ãŒã«ã€ããã¡ã€ã«ã«æçšã§ãã â
â â
â - :obj:`np.ndarray`ïŒç»åãè¡šãNumPyé
åã â
â - :obj:`PIL.Image.Image`ïŒPILã®ç»åãªããžã§ã¯ãã â
â â
â åŒæ°ïŒ â
â decode (:obj:`bool`ãããã©ã«ã㯠``True``)ïŒç»åããŒã¿ããã³ãŒããããã©ããã`False`ã®å Žåã â
â äžã«ç€ºãåºç€ãšãªãèŸæž {"path": image_path, "bytes": image_bytes} ãè¿ããŸãã â
â â
â decode = True â
â dtype = 'PIL.Image.Image' â
â id = None â
â pa_type = StructType(struct<bytes: binary, path: string>) â
â°ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¯
ç»åãæž¡ãæ¹æ³ã¯ããã€ããããŸããå°ãåŸã§ããã«ã€ããŠæ»ã£ãŠããŸãã
datasets
ã©ã€ãã©ãªã®çŽ æŽãããæ©èœã®1ã€ã¯ïŒããŒã¿ã®åŠçãã¡ã¢ãªãããã³ã°ãªã©ã®æ©èœä»¥å€ã«ãïŒããã€ãã®äŸ¿å©ãªæ©èœããç¡æãã§å©çšã§ããããšã§ãããã®äžã®1ã€ãfaiss
ã€ã³ããã¯ã¹ãããŒã¿ã»ããã«è¿œå ã§ããæ©èœã§ããfaiss
ã¯ããå¯ãªãã¯ãã«ã®å¹ççãªé¡äŒŒæ§æ€çŽ¢ãšã¯ã©ã¹ã¿ãªã³ã°ã®ããã®ã©ã€ãã©ãªãã§ãã
datasets
ã®ããã¥ã¡ã³ãã§ã¯ãããã¹ãæ€çŽ¢ã®ããã«faiss
ã€ã³ããã¯ã¹ã䜿çšããäŸã瀺ãããŠããŸãããã®æçš¿ã§ã¯ãç»åã§ãåãããšãã§ãããã©ãããèŠãŠã¿ãŸãããã
ããŒã¿ã»ãã: “Digitised Books – Images identified as Embellishments. c. 1510 – c. 1900”
ããã¯ãã€ã®ãªã¹å³æžé€šã®ããžã¿ã«åãããæžç±ã³ã¬ã¯ã·ã§ã³ããæœåºãããç»åã®ããŒã¿ã»ããã§ãããããã®ç»åã¯ãåºç¯ãªææããã³ããŸããŸãªåéã®æžç±ããååŸãããŠããŸããç»åã¯ãåæžç±ã®OCRïŒå åŠæåèªèïŒåºåã«å«ãŸããæ å ±ã䜿çšããŠæœåºãããŸããããã®ãããç»åãã©ã®æžç±ããæœåºããããã¯åãã£ãŠããŸãããç»åã«é¢ããä»ã®æ å ±ïŒäŸïŒç»åã«è¡šç€ºãããŠããå 容ïŒã¯å¿ ãããåãã£ãŠããŸããã
ãããå æããããã®ããã€ãã®è©Šã¿ã«ã¯ãç»åãFlickrã«ã¢ããããŒãããããšãå«ãŸããŠããŸããããã«ããã人ã ã¯ç»åã«ã¿ã°ãä»ããããããŸããŸãªã«ããŽãªã«åé¡ãããããããšãã§ããŸãã
ãŸããæ©æ¢°åŠç¿ã䜿çšããŠããŒã¿ã»ããã«ã¿ã°ãä»ãããããžã§ã¯ãããããŸãããã®äœæ¥ã«ãããã¿ã°ã§æ€çŽ¢ããããšãã§ããŸããããããè±ããªãæ€çŽ¢æ©èœãå¿ èŠãããããŸããããã®ç¹å®ã®å®éšã§ã¯ããè£ é£Ÿåããå«ãã³ã¬ã¯ã·ã§ã³ã®ãµãã»ããã§äœæ¥ããŸãããã®ããŒã¿ã»ããã¯å°ãå°ãããããå®éšã«é©ããŠããŸããè±åœå³æžé€šã®ããŒã¿ãªããžããªããå®å šãªããŒã¿ãååŸã§ããŸãïŒhttps://doi.org/10.21250/db17ãå®å šãªããŒã¿ã»ããã¯ãŸã ããªã倧ãããããå°ããªãµã³ãã«ããå§ããããšããå§ãããŸãã
ããŒã¿ã»ããã®äœæ
ããŒã¿ã»ããã¯ãç»åãå«ãŸãããµããã£ã¬ã¯ããªã®ãã©ã«ãã§æ§æãããŠããŸããããã¯ç»åããŒã¿ã»ãããå
±æããããã®ããªãæšæºçãªåœ¢åŒã§ããæè¿ããŒãžããããã«ãªã¯ãšã¹ãã®ãããã§ãdatasets
ã®ImageFolder
ããŒããŒã䜿çšããŠãã®ããŒã¿ã»ãããçŽæ¥ããŒãããããšãã§ããŸãð€¯
from datasets import load_dataset
dataset = load_dataset("imagefolder", data_files="https://zenodo.org/record/6224034/files/embellishments_sample.zip?download=1")
æ»ãå€ãèŠãŠã¿ãŸãããã
dataset
DatasetDict({
train: Dataset({
features: ['image', 'label'],
num_rows: 10000
})
})
DatasetDict
ãååŸã§ããŸãããç»åãšã©ãã«ã®ç¹åŸŽãæã€ããŒã¿ã»ããããããŸããããã§ã¯ãã¬ãŒãã³ã°/ããªããŒã·ã§ã³ã®åå²ããªããããããŒã¿ã»ããã®ãã¬ãŒãã³ã°éšåãååŸããŸãããããŸããããŒã¿ã»ããã®äŸã1ã€èŠãŠããããã©ã®ããã«ãªã£ãŠãããã確èªããŸãããã
dataset = dataset["train"]
dataset[0]
{'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=358x461 at 0x7F9488DBB090>,
'label': 208}
ã©ãã«åããå§ããŸããããããã¯ç»åã®èŠªãã©ã«ããè¡šããŠããŸãããã®å Žåãã©ãã«åã¯ç»åã®ååŸå
ã®æžç±ã®åºç幎ãè¡šããŠããŸããããã«é¢ãããããã³ã°ã¯ãdataset.features
ã䜿çšããŠç¢ºèªã§ããŸãïŒ
dataset.features['label']
ãã®ç¹å®ã®ããŒã¿ã»ããã§ã¯ãç»åãã¡ã€ã«åã«ãç»åãååŸãããæžç±ã«é¢ããã¡ã¿ããŒã¿ãå«ãŸããŠããŸãããã®æ å ±ãååŸããæ¹æ³ã¯ããã€ããããŸãã
ããŒã¿ã»ããã®äŸãèŠããšãimage
ã®ç¹åŸŽãPIL.JpegImagePlugin.JpegImageFile
ã§ããããšãããããŸããPIL.Images
ã«ã¯ãã¡ã€ã«åå±æ§ãããããããã¡ã€ã«åãååŸããããã«ããã«ã¢ã¯ã»ã¹ããæ¹æ³ããããŸãã
dataset[0]['image'].filename
/root/.cache/huggingface/datasets/downloads/extracted/f324a87ed7bf3a6b83b8a353096fbd9500d6e7956e55c3d96d2b23cc03146582/embellishments_sample/1920/000499442_0_000579_1_[The Ring and the Book etc ]_1920.jpg
ãã®æ
å ±ã«ç°¡åã«ã¢ã¯ã»ã¹ã§ããããã«ããããã«ãæ°ããåãäœæããŠãã¡ã€ã«åãæœåºããŸããããããã«ã¯map
ã¡ãœããã䜿çšããŸãã
dataset = dataset.map(lambda example: {"fname": example['image'].filename.split("/")[-1]})
1ã€ã®äŸãèŠãŠããããã©ã®ããã«ãªã£ãŠãããã確èªããŸãããã
dataset[0]
{'fname': '000499442_0_000579_1_[The Ring and the Book etc ]_1920.jpg',
'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=358x461 at 0x7F94862A9650>,
'label': 208}
ã¡ã¿ããŒã¿ãååŸããŸãããæ©éããã€ãã®ç»åãèŠãŠã¿ãŸãããïŒäŸã«ã¢ã¯ã»ã¹ããimage
åã«ã€ã³ããã¯ã¹ãä»ãããšãç»åã衚瀺ãããŸã ð
dataset[10]['image']
泚æ 以åã®ããŒãžã§ã³ã®ããã°èšäºã§ã¯ãç»åãããŠã³ããŒãããŠããŒãããæé ãã¯ããã«è€éã§ãããæ°ããImageFolderããŒããŒã䜿çšãããšããã®ããã»ã¹ãã¯ããã«ç°¡åã«ãªããŸã ð ç¹ã«ãç»åã®ããŒãæ¹æ³ãæ°ã«ããå¿ èŠã¯ãããŸãããããŒã¿ã»ããããããç§ãã¡ã®ããã«åŠçããŠãããŸãã
å šãŠã®ãã®ãããã«ããã·ã¥ããŸãããïŒ
ð€ãšã³ã·ã¹ãã ã®çŽ æŽãããç¹åŸŽã®äžã€ã¯ãHugging Face Hubã§ããããã䜿çšããŠã¢ãã«ãããŒã¿ã»ããã«ã¢ã¯ã»ã¹ããããšãã§ããŸããããã¯ä»ã®äººãšã®äœæ¥å
±æã«ãã䜿çšãããã»ããé²è¡äžã®äœæ¥ã«ã圹ç«ã€ããŒã«ã§ãã datasets
ã¯æè¿ãpush_to_hub
ã¡ãœãããè¿œå ããŸããããã®ã¡ãœããã䜿çšãããšãæéããããã«ããŒã¿ã»ãããããã«ããã·ã¥ããããšãã§ããŸããããã«ãããå€æãªã©ããã§ã«å®äºããããŒã¿ã»ãããå
±æããããšãã§ããéåžžã«äŸ¿å©ã§ãã
ä»ã®ãšãããããŒã¿ã»ãããããã«ããã·ã¥ããŠãæåã¯éå ¬éã«ä¿ã¡ãŸãã
ã³ãŒããå®è¡ããŠããå Žæã«ãã£ãŠã¯ãèªèšŒãå¿
èŠãªå ŽåããããŸããèªèšŒããã«ã¯ãhuggingface-cli login
ã³ãã³ãã䜿çšããããããŒãããã¯ã§å®è¡ããŠããå Žåã¯notebook_login
ã䜿çšã§ããŸãã
from huggingface_hub import notebook_login
notebook_login()
dataset.push_to_hub('davanstrien/embellishments-sample', private=True)
泚æïŒä»¥åã®ããŒãžã§ã³ã®ããã°èšäºã§ã¯ã
push_to_hub
ã䜿çšããŠç»åãåã蟌ãããã«ããã€ãã®æé ãè¿œå ããå¿ èŠããããŸããããã®ãã«ãªã¯ãšã¹ãã®ãããã§ããããã®è¿œå ã®æé ã«ã€ããŠå¿é ããå¿ èŠã¯ãããããŸãããåã«embed_external_files=True
ïŒããã©ã«ãã®åäœïŒã§ããããšã確èªããã ãã§æžã¿ãŸãã
ãã·ã³ã®åãæ¿ã
ãã®æç¹ã§ãããŒã¿ã»ãããäœæããããã«ç§»åããŸãããããã¯ãå¥ã®å Žæã§äœæ¥/ããŒã¿ã»ãããåéããããšãå¯èœã§ããããšãæå³ããŸãã
ãã®ç¹å®ã®äŸã§ã¯ãGPUãžã®ã¢ã¯ã»ã¹ãéèŠã§ããããŒã¿ãå ±æããããã«ããã䜿çšããããšã§ãã©ãããããã§äœæ¥ãéå§ããGoogle Colabã§äœæ¥ãåéããããšãã§ããŸãã
å¥ã®ãã·ã³ã«ç§»åããå Žåãå床ãã°ã€ã³ããå¿ èŠããããããããŸããããããè¡ã£ãåŸãããŒã¿ã»ãããããŒãããããšãã§ããŸãã
from datasets import load_dataset
dataset = load_dataset("davanstrien/embellishments-sample", use_auth_token=True)
åã蟌ã¿ã®äœæ ðž
ããã§ãç»åãããããå«ãŸããããŒã¿ã»ãããã§ããŸãããç»åæ€çŽ¢ã¢ããªãäœæããããã«ããããã®ç»åãåã蟌ãå¿
èŠããããŸãããããè¡ãããã«ã¯ããã€ãã®æ¹æ³ããããŸãããäžã€ã®å¯èœãªæ¹æ³ã¯ãsentence_transformers
ã©ã€ãã©ãªã䜿çšããŠCLIPã¢ãã«ã䜿çšããããšã§ããOpenAIã®CLIPã¢ãã«ã¯ãç»åãšããã¹ãã®äž¡æ¹ã®ããã®çµåè¡šçŸãåŠç¿ããŸããããã¯ãããã¹ããå
¥åããŠç»åãè¿ãå¿
èŠãããç§ãã¡ã®ç®çã«éåžžã«åœ¹ç«ã¡ãŸãã
SentenceTransformer
ã¯ã©ã¹ã䜿çšããŠã¢ãã«ãããŠã³ããŒãããããšãã§ããŸãã
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('clip-ViT-B-32')
ãã®ã¢ãã«ã¯ãç»åãŸãã¯ããã¹ãã®ãããããå
¥åãšããŠåãåããåã蟌ã¿ãè¿ããŸãããã®ã¢ãã«ã䜿çšããŠå
šãŠã®ç»åããšã³ã³ãŒãããããã«ãdatasets
ã®map
ã¡ãœããã䜿çšããããšãã§ããŸããmapãåŒã³åºããšãã¢ãã«ã«ãã£ãŠè¿ãããåã蟌ã¿ãå«ãŸããembeddings
ãšããããŒãæã€èŸæžãè¿ãããŸããã¢ãã«ãåŒã³åºãéã«ã¯device='cuda'
ãæž¡ããŸããããã«ããããšã³ã³ãŒããGPUäžã§è¡ãããŸãã
ds_with_embeddings = dataset.map(
lambda example: {'embeddings':model.encode(example['image'], device='cuda')}, batched=True, batch_size=32)
push_to_hub
ã䜿çšããŠãäœæ¥å
容ãããã«æ»ãããšã§ãäœæ¥ããä¿åãããããšãã§ããŸãã
ds_with_embeddings.push_to_hub('davanstrien/embellishments-sample', private=True)
ããå¥ã®ãã·ã³ã«ç§»åããå Žåã¯ãããããäœæ¥ãåãåºãããšãã§ããŸã ð
from datasets import load_dataset
ds_with_embeddings = load_dataset("davanstrien/embellishments-sample", use_auth_token=True)
ããã§ãç»åã®åã蟌ã¿ãå«ãæ°ããåãæã€ããŒã¿ã»ãããã§ããŸãããããããæåã§æ€çŽ¢ããå
¥åã®åã蟌ã¿ãšæ¯èŒããããšãã§ããŸãããdatasetsã«ã¯add_faiss_index
ã¡ãœããããããŸããããã¯ãåã蟌ã¿ãæ€çŽ¢ããããã®å¹ççãªã€ã³ããã¯ã¹ãäœæããããã«faissã©ã€ãã©ãªã䜿çšããŸãããã®ã©ã€ãã©ãªã«ã€ããŠã®è©³çŽ°ã¯ããã®YouTubeãããªãã芧ãã ããã
ds_with_embeddings['train'].add_faiss_index(column='embeddings')
Dataset({
features: ['fname', 'year', 'path', 'image', 'embeddings'],
num_rows: 10000
})
ç»åæ€çŽ¢
泚æ:ãããã®äŸã¯ããŒã¿ã»ããã®å®å šçããçæãããŠãããããè¥å¹²ç°ãªãçµæãåŸãããå¯èœæ§ããããŸãã
ä»ãã·ã³ãã«ãªç»åæ€çŽ¢ãäœæããããã«å¿ èŠãªãã¹ãŠã®èŠçŽ ãæã£ãŠããŸããç»åããšã³ã³ãŒãããããã«äœ¿çšããã¢ãã«ãšåãã¢ãã«ã䜿çšããŠãå ¥åããã¹ãããšã³ã³ãŒãã§ããŸããããã¯ãè¿ãäŸãèŠã€ããããšããããã³ãããšããŠæ©èœããŸãããŸãã¯ãèžæ°æ©é¢è»ãããå§ããŸãããã
prompt = model.encode("èžæ°æ©é¢è»")
ããŒã¿ã»ããã©ã€ãã©ãªã®get_nearest_examples
ã¡ãœããã䜿çšããŠãå
¥åããã³ããã®åã蟌ã¿ã«è¿ãåã蟌ã¿ãæã€ç»åãååŸã§ããŸããè¿ãããçµæã®æ°ãæå®ã§ããŸãã
scores, retrieved_examples = ds_with_embeddings['train'].get_nearest_examples('embeddings', prompt, k=9)
ååŸããçµæã®æåã®äŸã«ã¢ã¯ã»ã¹ã§ããŸã:
retrieved_examples['image'][0]
ããã¯å®å šã«èžæ°æ©é¢è»ã§ã¯ãããŸããããå®å šã«å¥åŠãªçµæã§ããããŸãããä»ã®çµæãããããããŠè¿ããããã®ã確èªã§ããŸãã
import matplotlib.pyplot as plt
plt.figure(figsize=(20, 20))
columns = 3
for i in range(9):
image = retrieved_examples['image'][i]
plt.subplot(9 / columns + 1, columns, i + 1)
plt.imshow(image)
ãããã®çµæã®äžéšã¯å ¥åããã³ããã«ããªãè¿ãããã«èŠããŸããããŸããŸãªããã³ããã§ç°¡åã«è©Šãããšãã§ããããã«ããããé¢æ°ã§å ã¿ãŸãã
def get_image_from_text(text_prompt, number_to_retrieve=9):
prompt = model.encode(text_prompt)
scores, retrieved_examples = ds_with_embeddings['train'].get_nearest_examples('embeddings', prompt, k=number_to_retrieve)
plt.figure(figsize=(20, 20))
columns = 3
for i in range(9):
image = retrieved_examples['image'][i]
plt.title(text_prompt)
plt.subplot(9 / columns + 1, columns, i + 1)
plt.imshow(image)
get_image_from_text("倪éœã®è£ã«ããå±±ã®ã€ã©ã¹ã")
ããŸããŸãªããã³ãããè©Šã âš
ããã€ãã®ç°ãªãããã³ãããè©ŠããŠã¿ãããšãã§ããã®ã§ãçµæãèŠãŠã¿ãŸããã:
-
äžéšã®ããã³ããã¯ãåºããã«ããŽãªããéžæããŸããäŸãã°ãã楜åšãããåç©ããªã©ã§ããä»ã®ããã³ããã¯å ·äœçãªãã®ã§ããäŸãã°ããã®ã¿ãŒãã§ãã
-
èå³æ¬äœã§ããŒã«æŒç®åãè©ŠããŠã¿ãŸãã:ãç«ãŸãã¯ç¬ã®ã€ã©ã¹ããã
-
æåŸã«ãå°ãæœè±¡çãªãã®ãè©ŠããŠã¿ãŸãã:ã空ã£ãœã®æ·±æ·µãã
prompts = ["楜åš", "ã®ã¿ãŒ", "åç©", "ç«ãŸãã¯ç¬ã®ã€ã©ã¹ã", "空ã£ãœã®æ·±æ·µ"]
for prompt in prompts:
get_image_from_text(prompt)
ãããã®çµæã¯åžžã«æ£ç¢ºã§ã¯ãããŸããããéåžžã¯åŠ¥åœãªçµæã§ãããã§ã«ããã®ããŒã¿ã»ããå ã®ç»åã®æå³çãªå 容ãæ€çŽ¢ããããã«åœ¹ç«ã€å¯èœæ§ãããããã«æãããŸãããã ãããã®ãŸãŸå ±æããã®ã¯æ§ãããããããŸãã…
Hugging Face Spaceã®äœæ? ð€·ðŒ
ãã®ãããªãããžã§ã¯ãã®æ¬¡ã®æãããªã¹ãããã¯ãHugging Face Spaceã®ãã¢ãäœæããããšã§ããä»ã®ã¢ãã«ã§ããããè¡ã£ãŠããŸãã
ãããŸã§æ¥ãã®ã«ãGradioã¢ããªã®ã»ããã¢ããã¯ããªãç°¡åãªããã»ã¹ã§ããã以äžã¯ãã®ã¢ããªã®ã¹ã¯ãªãŒã³ã·ã§ããã§ãïŒ
ãã ãããã®ã¢ããªãããã«å ¬éããããšã«ã¯å°ãæ éã§ããCLIPã¢ãã«ã®ã¢ãã«ã«ãŒããèŠããšãäž»ãªäœ¿çšç®çã¯æ¬¡ã®ãšããã§ãïŒ
äž»ãªäœ¿çšç®ç
ãã®ã¢ãã«ã¯ãç 究è ãã³ã³ãã¥ãŒã¿ããžã§ã³ã¢ãã«ã®å ç¢æ§ãæ±åèœåãããã³ãã®ä»ã®æ©èœããã€ã¢ã¹ãããã³å¶çŽãããè¯ãç解ããããã«äœ¿çšãããããšãæ³å®ããŠããŸãããœãŒã¹
ããã¯ãç§ãã¡ãããã§èå³ãæã£ãŠããããšã«ããªãè¿ãã§ããç¹ã«ãç§ãã¡ã¯ããŒã¿ã»ããã®çš®é¡ïŒäž»ã«19äžçŽã®æžç±ã®ã€ã©ã¹ãïŒã«å«ãŸããç»åã«ã¢ãã«ãã©ãã ã察åŠã§ãããã«èå³ããããããããŸãããç§ãã¡ã®ããŒã¿ã»ããã®ç»åã¯ïŒããããïŒãã¬ãŒãã³ã°ããŒã¿ãšã¯ããªãç°ãªãã¯ãã§ãããŸããäžéšã®ç»åã«ã¯ããã¹ããå«ãŸããŠãããããCLIPã«ã¯OCRã®èœåããããšããããšã圹ç«ã€ãããããŸããã
ãã ããã¢ãã«ã«ãŒãã®å¯Ÿè±¡å€ã®äœ¿çšäŸãèŠããšïŒ
察象å€ã®äœ¿çšäŸ
ã¢ãã«ã®ãããã€ããã䜿çšäŸïŒåæ¥çã§ããããšãªããããšïŒã¯çŸåšå¯Ÿè±¡å€ã§ããç¹å®ã®ã¯ã©ã¹ã¿ã¯ãœãããŒãšã®ç¹å®ã®ãã¡ã€ã³å ãã¹ããè¡ãããªãéããå¶çŽãããç°å¢ã§ã®ç»åæ€çŽ¢ãªã©ã®éãããã€ããã䜿çšäŸããå§ãã§ããŸãããããã¯ãå®å šæ§è©äŸ¡ã«ãããŠãCLIPã®ããã©ãŒãã³ã¹ãç°ãªãã¯ã©ã¹ã¿ã¯ãœãããŒã«å¯ŸããŠé«ãæ€æ»ã®å¿ èŠæ§ã瀺ãããããã§ããããã«ãããçŸåšã®ãšãããæªãã¹ãããã³éå¶çŽã®ã¢ãã«ã®ä»»æã®äœ¿çšäŸã§ã®ãããã€ã¡ã³ãã¯æœåšçã«æ害ã§ãããœãŒã¹
ããããã€ã¡ã³ããã¯è¯ãèãã§ã¯ãªããšç€ºåããŠããŸããç§ãåŸãçµæã¯èå³æ·±ãã§ããããŸã ã¢ãã«ã§ååã«éãã§ããŸãããïŒããã©ãŒãã³ã¹ããã€ã¢ã¹ãè©äŸ¡ããããã®ã·ã¹ãããã£ãã¯ãªã¢ãããŒããè¡ã£ãŠããŸããïŒããããããããã€ãããèªä¿¡ããããŸãããããäžã€ã®è¿œå ã®èæ ®äºé ã¯ã察象ã®ããŒã¿ã»ãããã®ãã®ã§ããç»åã¯ããŸããŸãªäž»é¡ãæ代ã®æžç±ããæœåºãããŠããŸããæ€æ°å°äž»çŸ©ãåæ ããŠããæžç±ãå€ãããããã®çµæãå«ãŸããŠããäžéšã®ç»åã¯ç¹å®ã®äººã ãåŠå®çã«è¡šçŸããŠããå¯èœæ§ããããŸããããã¯ãä»»æã®ããã¹ãå ¥åãããã³ãããšããŠãšã³ã³ãŒãã§ããããŒã«ãšçµã¿åããããšæœåšçã«åé¡ãçããå¯èœæ§ããããŸãã
ãã®åé¡ã«å¯Ÿããæ¹æ³ã¯ãããããããŸããããããå°ãèããå¿ èŠããããŸãã
çµè«
ãã¢ãèŠããããšã¯ã§ããŸããããdatasets
ã䜿çšããŠæ¬¡ã®ããšãã§ããããšãèŠãŠããŸããïŒ
- æ°ãã
Image
æ©èœã¿ã€ãã«ç»åãèªã¿èŸŒã push_to_hub
ã䜿çšããŠäœæ¥ããä¿åãããããã䜿çšããŠããŒã¿ããã·ã³/ã»ãã·ã§ã³éã§ç§»åãã- ããã¹ãïŒãŸãã¯ç»åïŒã®å
¥åããç»åãååŸããããã«äœ¿çšã§ãã
faiss
ã€ã³ããã¯ã¹ãäœæãã
We will continue to update VoAGI; if you have any questions or suggestions, please contact us!
Was this article helpful?
93 out of 132 found this helpful
Related articles
- æµå¯ŸçãªããŒã¿ã䜿çšããŠã¢ãã«ãåçã«ãã¬ãŒãã³ã°ããæ¹æ³
- ð€ Datasetsã§ã®æ°ãããªãŒãã£ãªãšããžã§ã³ã®ããã¥ã¡ã³ããŒã·ã§ã³ã玹ä»ããŸã
- ããŒã¿ã»ãããšã¢ãã«ã«ãããDOIïŒããžã¿ã«ãªããžã§ã¯ãèå¥åïŒã®çŽ¹ä»
- ãã¢ã¢ãŒãã£ãã¯æå·åã«ããæå·åããŒã¿ã®ææ åæ
- ãªãŒãã£ãªããŒã¿ã»ããã®å®å šã¬ã€ã
- Hugging FaceããŒã¿ã»ãããšãã©ã³ã¹ãã©ãŒããŒã䜿çšããç»åã®é¡äŒŒæ§
- Hugging Faceããã©ã³ã¹ã®ããŒã¿ä¿è·æ©é¢ã®åŒ·åãµããŒãããã°ã©ã ã«éžã°ããŸãã