Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about image_pool coding #23

Open
nalibjchn opened this issue Jul 31, 2019 · 0 comments
Open

about image_pool coding #23

nalibjchn opened this issue Jul 31, 2019 · 0 comments

Comments

@nalibjchn
Copy link

nalibjchn commented Jul 31, 2019

fake_pool[random_id] = fake --- what does use for in dis code? coz it return temp

def fake_image_pool(self, num_fakes, fake, fake_pool):
''' dis function saves teh generated image to corresponding pool of images.
In starting. It keeps on feeling teh pool till it is full and tan randomly selects an
already stored image and replace it with new one.'''

    if(num_fakes < pool_size):
        fake_pool[num_fakes] = fake
        return fake
    else :
        p = random.random()
        if p > 0.5:
            random_id = random.randint(0,pool_size-1)
            temp = fake_pool[random_id]
            fake_pool[random_id] = fake
            return temp
        else :
            return fake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant