o
    Ni                     @   s~   d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ dZ	dZ
dZd	Zd
ZdZeedfZg dZG dd dejjZdS )z=Beans leaf dataset with images of diseased and health leaves.    )absolute_import)division)print_functionNz@ONLINE {beansdata,
    author="Makerere AI Lab",
    title="Bean disease dataset",
    month="January",
    year="2020",
    url="https://github.com/AI-Lab-Makerere/ibean/"
}
af  Beans is a dataset of images of beans taken in the field using smartphone
cameras. It consists of 3 classes: 2 disease classes and the healthy class.
Diseases depicted include Angular Leaf Spot and Bean Rust. Data was annotated
by experts from the National Crops Resources Research Institute (NaCRRI) in
Uganda and collected by the Makerere AI research lab.
z/https://storage.googleapis.com/ibeans/train.zipz4https://storage.googleapis.com/ibeans/validation.zipz.https://storage.googleapis.com/ibeans/test.zipi     )angular_leaf_spot	bean_rusthealthyc                   @   s4   e Zd ZdZejdZdd Zdd Z	dd Z
d	S )
Beansz Beans plant leaf images dataset.z0.1.0c              	   C   s:   t jj| tt jt jjtdt jjt	ddddt
dS )N)shape)namesimagelabelz)https://github.com/AI-Lab-Makerere/ibean/)builderdescriptionfeaturessupervised_keyshomepagecitation)tfdscoreDatasetInfo_DESCRIPTIONr   FeaturesDictImage_IMAGE_SHAPE
ClassLabel_LABELS	_CITATION)self r    b/home/ubuntu/.local/lib/python3.10/site-packages/tensorflow_datasets/image_classification/beans.py_info<   s   zBeans._infoc                 C   sn   | tttg\}}}tjjtjjd|	|idtjjtjj
d|	|idtjjtjjd|	|idgS )Narchive)name
gen_kwargs)download
_TRAIN_URL_VALIDATION_URL	_TEST_URLr   r   SplitGeneratorSplitTRAINiter_archive
VALIDATIONTEST)r   
dl_manager
train_pathval_path	test_pathr    r    r!   _split_generatorsI   s&   



zBeans._split_generatorsc                 c   sF    |D ]\}}| dsq|tjjd }||d}||fV  qdS )zYields examples.z.jpgr   N)endswithsplitospathsep)r   r#   fnamefobjr   recordr    r    r!   _generate_examples_   s   
zBeans._generate_examplesN)__name__
__module____qualname____doc__r   r   VersionVERSIONr"   r4   r>   r    r    r    r!   r	   7   s    r	   )rB   
__future__r   r   r   r8   tensorflow_datasets.public_api
public_apir   r   r   r'   r(   r)   _IMAGE_SIZEr   r   r   GeneratorBasedBuilderr	   r    r    r    r!   <module>   s   

