towhee.trainer.utils.plot_utils.image_folder_sample_show¶
- towhee.trainer.utils.plot_utils.image_folder_sample_show(root: str, rows: int = 4, cols: int = 4, img_size: int = 224, classes: Optional[List[str]] = None)[source]¶
Show sample images 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
``` it’s useful to observe the images for different categories. You can randomly sample categories, or specify show classes. :param root: Root of ImageFolder instance. :type root: str :param rows: Count of show rows. :type rows: int :param cols: Count of show cols. :type cols: int :param img_size: Show image shape, if int, it’s a square. :type img_size: int or tuple :param classes: The specified classes you want to see. If not None, param rows will be invalid. :type classes: Optional[list[str]]