Skip to content

Commit

Permalink
Add verify util script
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-bishopfox committed Apr 21, 2021
1 parent 361b47b commit 92738b1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/resizer.sh
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
28 changes: 28 additions & 0 deletions utils/verify.py
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)

0 comments on commit 92738b1

Please sign in to comment.