mercredi 8 septembre 2021

I want to save my random choiced images in my folder

import os, random
import numpy
from PIL import Image

path = "C:/Users/mark03/Desktop/rmv_1_loan_0908/images"
save_path = "C:/Users/mark03/Desktop/rmv_1_loan_0908/random"

file_list = os.listdir(path)
def selectRandom(file_list):
    return numpy.random.choice(file_list, 3, False)

print(selectRandom(file_list))

Hi there! I want to save 'my random choiced images' in my folder. But in this code,

I just check image names, but these images are not saved in my folder. So I want to plus code about save in my folder.

Is there any good way to solve the problem??? thank you!

enter image description here




Aucun commentaire:

Enregistrer un commentaire