Skip to content

Instantly share code, notes, and snippets.

@Syzygy2048
Created February 16, 2018 11:42
Show Gist options
  • Save Syzygy2048/29e0174a40f478139a0911297e3252b5 to your computer and use it in GitHub Desktop.
Save Syzygy2048/29e0174a40f478139a0911297e3252b5 to your computer and use it in GitHub Desktop.
from skimage import io
def extract_annotations(path):
image = io.imread("data/cowc/datasets/ground_truth_sets/Toronto_ISPRS/03559_Annotated_Cars.png")
print('%d, %d' % (image.shape[0], image.shape[1]))
i = 1;
for x in range(0, image.shape[0]):
for y in range(0, image.shape[1]):
if image[x][y][0] > 0:
i = i + 1
print('%d - %d, %d' % (i, x, y))
extract_annotations("")
Traceback (most recent call last):
File "train/annotation_detector.py", line 25, in <module>
extract_annotations("")
File "train/annotation_detector.py", line 17, in extract_annotations
print('%d - %d, %d' % (i, x, y))
OSError: raw write() returned invalid length 34 (should have been between 0 and 17)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment