Skip to content

about image_pool coding #23

Description

@nalibjchn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions