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
- name: ocr-detector | |
inputs: | |
artifacts: | |
- name: tsrc | |
path: /mnt/src/train | |
git: | |
repo: 'https://github.com/onepanelio/LicensePlateOcr.git' | |
- git: | |
repo: https://github.com/tensorflow/models.git | |
name: src |
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
- name: license-detector | |
inputs: | |
artifacts: | |
- name: src | |
path: /mnt/src | |
git: | |
repo: "https://github.com/onepanelio/LicensePlateOcr.git" | |
- name: data | |
path: /mnt/data/datasets/ | |
s3: |
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
arguments: | |
parameters: | |
- name: source | |
value: https://github.com/tensorflow/models.git | |
displayName: Model source code | |
type: hidden | |
visibility: private | |
- name: trainingsource | |
value: https://github.com/onepanelio/LicensePlateOcr.git |
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
def run(checkpoint, batch_size, dataset_name, image_path_pattern, annotations): | |
images_placeholder, endpoints = create_model(batch_size, | |
dataset_name) | |
session_creator = monitored_session.ChiefSessionCreator( | |
checkpoint_filename_with_path=checkpoint) | |
count = 0 | |
width, height = get_dataset_image_size(dataset_name) | |
with monitored_session.MonitoredSession( | |
session_creator=session_creator) as sess: | |
for path,boxes in annotations.items(): |
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
python train.py \ | |
--dataset_name=custom \ | |
--batch_size=1 \ | |
--train_log_dir=/mnt/output/ \ | |
--checkpoint=model.ckpt-399731 \ | |
--max_number_of_steps=110000 |
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
def get_crops(args): | |
tree = ET.parse(args.xml_file) | |
root = tree.getroot() | |
count = 0 | |
if not os.path.exists(args.output_dir): | |
os.makedirs(args.output_dir) | |
for image in root.iter('image'): | |
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
scores = detection_graph.get_tensor_by_name('detection_scores:0') | |
classes = detection_graph.get_tensor_by_name('detection_classes:0') | |
num_detections = detection_graph.get_tensor_by_name('num_detections:0') | |
(boxes, scores, classes, num_detections) = sess.run([boxes, scores, classes, num_detections], feed_dict={image_tensor: image_np_expanded}) | |
result = [] | |
for i in range(len(classes[0])): | |
if scores[0][i] >= 0.5: | |
xmin, ymin, xmax, ymax = _normalize_box(boxes[0][i], width, height) | |
label = CLASSES[classes[0][i]] |
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
#Source code with the blog post at http://monik.in/a-noobs-guide-to-implementing-rnn-lstm-using-tensorflow/ | |
import numpy as np | |
import random | |
from random import shuffle | |
import tensorflow as tf | |
# from tensorflow.models.rnn import rnn_cell | |
# from tensorflow.models.rnn import rnn | |
##Create Dataset## |
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 tensorflow as tf | |
#create a variable | |
#Synatx - tf.Variable(<initial-value>, name="") | |
x = tf.Variable(3, name="x") | |
y = tf.Variable(4, name="y") | |
#add x,y | |
c = tf.add(x,y) |