towhee.trainer.utils.plot_utils.image_folder_statistic

towhee.trainer.utils.plot_utils.image_folder_statistic(root: str, classes: Optional[List[str]] = None, show_bar: Optional[bool] = False)[source]

Show count statistic infos for torchvision.datasets.ImageFolder. Put another way, the image root path structure just need to be like this: ``` root-|

#classname1#-|

image-1.jpg image-2.jpg

#classname2-|

image-1.jpg image-2.jpg



#classnameN-|

image-1.jpg image-2.jpg

``` :param root: Root of ImageFolder instance. :type root: str :param classes: The specified classes of statistic. If not None, all class statistic will be return. :type classes: Optional[List[str]] :param show_bar: Whether showing bar graph. :type show_bar: Optional[bool]

Returns:

(dict)

Count statistic info, where key is category name, value is the count.