This file contains hidden or 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
import numpy as np | |
from PIL import Image | |
from google.colab.patches import cv2_imshow | |
def load_image_into_numpy_array(path): | |
"""Load an image from file into a numpy array. | |
Puts image into numpy array to feed into tensorflow graph. | |
Note that by convention we put it into a numpy array with shape | |
(height, width, channels), where channels=3 for RGB. |
This file contains hidden or 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
output_directory = 'exported-models/' | |
# goes through the model is the training/ dir and gets the last one. | |
# you could choose a specfic one instead of the last | |
lst = os.listdir("models/my_mobilenet/") | |
# print(lst) | |
lst = [l for l in lst if 'ckpt-' in l and '.index' not in l] | |
steps=np.array([int(re.findall('\d+', l)[0]) for l in lst]) | |
last_model = lst[steps.argmax()] | |
last_model_path = os.path.join('models/my_mobilenet', last_model) |
This file contains hidden or 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
import pandas as pd | |
import numpy as np | |
import csv | |
import re | |
import cv2 | |
import os | |
import glob | |
import xml.etree.ElementTree as ET | |
import io |
NewerOlder