-
Notifications
You must be signed in to change notification settings - Fork 147
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
create negative_py #35
Comments
Hi, |
thanks for your quick reply
I sent you the error in appendix if you cant read it
changing the break to exit(0) didn't work
…On Fri, Apr 7, 2017 at 9:06 PM, Anson Yu ***@***.***> wrote:
Hi,
Sorry, the script is indeed kind of messy!
I think you can try modifying line 51 to exit(0) instead of break
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AZbyMlAzItAWXsZZEuQgtIXhbi4pdelhks5rtmYHgaJpZM4M2nK2>
.
|
Try adding |
sorry, I should have changed the line ends with jpeg to jpg.
now another error occures
|
I have added some lines in the code, is it OK?
|
Yes, this should work! |
Hi Hong, I think the problem is wrong indentation compared to the code microhua pasted.
|
Dear Anson:
Thank you so much for your reply.
haha, i also found that problem after i checked the entire code, and i have
solved it.
If i still met some problem in the future, i hope i can sent email to you
for your help.
Sincerely Yours.
Hong
2018-06-11 4:48 GMT+09:00 Anson Yu <[email protected]>:
… Hi Hong,
I think the problem is wrong indentation compared to the code microhua
pasted.
The code with the line starting from read_img_name should be indented to
the right.
for current_image in range((current_neg_dir - 1)*300, (current_neg_dir - 1)*300 + 300): # take 300 images
if current_image > (number_of_pictures - 1):
break
if current_image % 100 == 0:
print "Processing image number " + str(current_image)
read_img_name = data_base_dir + '/' + file_list[current_image].strip()
img = cv2.imread(read_img_name) # read image
height, width, channels = img.shape
crop_size = min(height, width) / 2 # start from half of shorter side
while crop_size >= 12:
for start_height in range(0, height, 100):
if (start_height + crop_size) > height:
break
for start_width in range(0, width, 100):
if (start_width + crop_size) > width:
break
cropped_img = img[start_height : start_height + int(crop_size), start_width : start_width + int(crop_size)]
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AZJ2TBbTfUJcJkU_Q26icwlBO1yF4qK-ks5t7Xf8gaJpZM4M2nK2>
.
|
Hi!
when I am trying to run create negative_py, I get the error:
read_img_name = data_base_dir + '/' + file_list[current_image].strip()
IndexError: list index out of range
can u help me with this please?
I have just created 340 scenery images in the directory
btw, I am not a pro. just a beginner
thanks a lot!
The text was updated successfully, but these errors were encountered: