-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
361b47b
commit 92738b1
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# Converts full-size images to a given size (replacing the originals) | ||
for f in images_full_size/* | ||
for f in images/* | ||
do | ||
echo $f | ||
convert -resize 224x224\! $f $f | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import csv | ||
import random | ||
from os import listdir | ||
from os.path import isfile, join | ||
|
||
with open("labels.csv", newline="") as csvfile: | ||
# Get the header labels | ||
csvreader = csv.DictReader(csvfile) | ||
# fieldnames = next(csvreader) | ||
file_list = [f for f in listdir("images") if isfile(join("images", f))] | ||
|
||
label_list = [] | ||
for row in csvreader: | ||
label_list.append(row["filename"]) | ||
|
||
# Loop through the file | ||
print("Rows in labels.csv, but no image exists:") | ||
for label in label_list: | ||
if label not in file_list: | ||
print(row["filename"]) | ||
|
||
print("Images that exist, but don't have labels:") | ||
i = 0 | ||
for image in file_list: | ||
if image not in label_list: | ||
print(image) |