We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
class ImagePool(object): def __init__(self, maxsize=50): self.maxsize = maxsize self.num_img = 0 self.images = [] def __call__(self, image): if self.maxsize == 0: return image if self.num_img < self.maxsize: self.images.append(image) self.num_img=self.num_img+1 //It seems you forgot this line return image if np.random.rand() > 0.5: idx = int(np.random.rand()*self.maxsize) tmp = copy.copy(self.images[idx]) self.images[idx] = image return tmp else: return image
The text was updated successfully, but these errors were encountered:
Thank you for your help. I have fixed the bug in the latest commit.
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: