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

stucked when I process image in the cycle #430

Open
kukugpt opened this issue Apr 2, 2024 · 5 comments
Open

stucked when I process image in the cycle #430

kukugpt opened this issue Apr 2, 2024 · 5 comments

Comments

@kukugpt
Copy link

kukugpt commented Apr 2, 2024

ink_phase = [Letterpress(blur=0.0, n_samples=(100,300), n_clusters=(100,350), std_range=(1000, 3000), value_range=(180,255), p=p), # foreground
]
paper_phase = [DirtyScreen(p=p), #background
NoiseTexturize(sigma_range=(1,5), turbulence_range=(1,4), p=0.8), #background
]

post_phase = [ ]
pipeline = AugraphyPipeline(ink_phase, paper_phase, post_phase)

for img_path in tqdm(img_file_list[27:]):
img_path = img_path.strip()
img = cv2.imread(img_path)
aug_imgx2 = pipeline(img)

@kwcckw
Copy link
Collaborator

kwcckw commented Apr 2, 2024

Hi, what do you mean by stuck here? Is the Python still running? Or it crashes?

@kukugpt
Copy link
Author

kukugpt commented Apr 2, 2024

python is running but can not obtain the result

@kukugpt
Copy link
Author

kukugpt commented Apr 2, 2024

This problem seems to be a problem in NoiseTexturize, when exec "augmentations/noisetexturize.py", line 74, in noise
result = np.random.normal(0, sigma, size=(ysize, xsize)"

@kukugpt
Copy link
Author

kukugpt commented Apr 2, 2024

it made by turbulence_range=(1,4), which I have made a pull request

@kwcckw
Copy link
Collaborator

kwcckw commented Apr 2, 2024

Thanks, i was able to identify the root cause and it's due to an infinity loop caused by ratio = (ratio // turbulence) or 1. So turbulence must > 1, else ratio will never == 1. I will push a patch shortly.

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

2 participants