-
Notifications
You must be signed in to change notification settings - Fork 153
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
Chapter 8 - data.py #7
Comments
Hi Oscar, |
Hi Miaecle, Thanks for your quick response! this is the problem I am having..... image_names = [ p for p in os.listdir(images_path) if p.startswith('cut_') and p.endswith('.png') ] -- image_name -- after image_names = [ p for p in os.listdir(images_path) if p.startswith('cut_') and p.endswith('.png') ] and you can see in the lower right pane that 'cut_raw_images' is reading all the images Hope you can help me. Thanks, |
@TheStoneMX Oh I think I find where might go wrong. I don't have the codes with me right now but I will try to run the codes later today. Can you check if there is a new folder called |
@miaecle , Thanks for the response, there is a cut directory, but there is nothing there because the code never gets executed....
Thanks, -Oscar. |
@miaecle , Why do we need to make every image a png and not leave it as a jpeg ? Thanks, |
@TheStoneMX So it is not a jpeg/png issue, basically we need to cut the image so that we can fit it into the network. Please see PR #8 for the quick fix, right now the data loading part should be clean. Let me know if you find any further issues. |
@miaecle thanks a lot for the fix! it is working now, but there is one more thing that needs fixing.... sorry. I found that the code wasn't writing any images to disk.... and found the cv2.imwrite does not raise an exception when it can't find the path.
so looking at the code I found that it creates a directory cut, one level abobe train, but it tries to write to /train/cut/ cut being inside the train directory. |
I never said it was a jpeg/ png issue.... The questions are why do you need to feed the network png's and not just jpeg's ..... because the way it is being done, it takes about 4 days to write 35 thousand images to disk, it has been 12 hours since I started and I have only written 2764 images to disk.... and I have x299 board with X9960 processor with SSD disk.... I can't imagine how low it will take someone with the less fast computer and a regular hard drive. unless I am missing something here. Thanks for your great support! I will make sure I mention it on amazon review of the book. |
@TheStoneMX I see what you mean, thanks for the feedback! I will try optimize the pipeline to accelerate the preprocessing step. |
Hi there,
I was trying to run the code but it does not run, in line 41 you are looking for
image_names = [p for p in os.listdir(images_path)if p.startswith('cut_') and p.endswith('.png')]
But there are no png images in the rep that I downloaded from Kaggle, all the images are in jpeg format.
and in the list you build in :
for im in image_names:
if im.endswith('.jpeg') and not im.startswith('cut_') and not 'cut_' + im in image_names:
raw_images.append(im)
Does not get used at all the raw_images ....
I am trying to understand why you are looking for 'cut_' there is no image that starts or ends with 'cuts_'
Can you please help me get a working version.
Thanks.
Oscar.
The text was updated successfully, but these errors were encountered: