Replies: 1 comment
-
you are not accessing you global seed variable in the function so you need to force python to access it seed = 1
def Image_catch():
global seed # access the global variable
random.seed(seed)
seed += 1
img_path_list = list(image_path.glob("*/*/*.jpg"))
random_path = random.choice(img_path_list)
image_lable = random_path.parent.stem
img = Image.open(random_path) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to produce different output for each time I call this function but same overall output each time I run my code so I wrote this:
but it gives the same image every time. I even changed the seed manually but somehow I still got the same image. what did i possibly did wrong here
Beta Was this translation helpful? Give feedback.
All reactions