Hi, it probably recognizes the square bracket as wildcard. Try using a double-backticks to escape the brackets, otherwise, I recommend you rename without the brackets and train again.
cv2.imwrite(str(output_dir / 'test``[``].jpg'), test_image)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, I am using Azure Machine Learning studio.
I trained my deep learning model on computing cluster, and then outputs images onto 'outputs' directory.
However, in Experiment > Run > outputs + logs tab, directories was displayed instead of my images.
Is it possible to get my images from 'outputs' directory?
After investigation, I recognized that images which have filename containing square brackets is not shown in the tab.
For instance, if I created 'outputs/test[0].jpg', then 'outputs/test' directory was shown in the tab.
[Sample code]
import cv2
import numpy as np
from pathlib import Path
# Check whether output directory exists or not
output_dir = Path('./outputs/')
if not output_dir.exists():
output_dir.mkdir()
# Generate test image
IMAGE_SIZE = (28, 28)
test_image = np.zeros(IMAGE_SIZE)
# Save image with filename which contained / not contained square brackets
# 'test.jpg' and 'test' directory will be shown in the 'outputs' directory, however 'test[].jpg' and 'test[0].jpg' are disappeared.
cv2.imwrite(str(output_dir / 'test.jpg'), test_image)
cv2.imwrite(str(output_dir / 'test[].jpg'), test_image)
cv2.imwrite(str(output_dir / 'test[0].jpg'), test_image)
Hi, it probably recognizes the square bracket as wildcard. Try using a double-backticks to escape the brackets, otherwise, I recommend you rename without the brackets and train again.
cv2.imwrite(str(output_dir / 'test``[``].jpg'), test_image)
Appreciate your reply.
Although I tried adding double-backticks to escape square brackets, I cannot find my images in the workspace.
[Fixed Code]
(Omission)
# Save image with filename which contained / not contained square brackets
cv2.imwrite(str(output_dir / 'test.jpg'), test_image)
cv2.imwrite(str(output_dir / 'test[].jpg'), test_image)
cv2.imwrite(str(output_dir / 'test[0].jpg'), test_image)
cv2.imwrite(str(output_dir / 'test``[``].jpg'), test_image) # Escape square brackets with double-backticks
cv2.imwrite(str(output_dir / 'test``[0``].jpg'), test_image) # Escape square brackets with double-backticks
Results:
New directory with backticks appeared.
And I will rename image files from next experiment,
however I wish to get my image generated in my previous experiment because of the experiment's long elapsed time.
Are there any good methods for that?
Appreciate your help.
I will re-execute my experiment with images renaming.