Skip to content

Commit

Permalink
Release smoothing
Browse files Browse the repository at this point in the history
  • Loading branch information
JanPalasek committed Apr 23, 2020
1 parent 64d7549 commit 840f9c1
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 20 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
10 changes: 0 additions & 10 deletions src/captcha_detection/captcha_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,9 @@
import numpy as np
import tensorflow as tf
from tensorflow_core.python.keras.utils.vis_utils import plot_model
from tensorflow.keras import backend as K

from accuracy.correctly_classified_captcha_accuracy import CorrectlyClassifiedCaptchaAccuracy
from dataset.captcha_dataset import CaptchaDataset
from dataset.data_batcher import DataBatcher
from dataset.preprocessing.image_preprocessors.image_cut_preprocessor import ImageCutPreprocessor
from dataset.preprocessing.image_preprocessors.image_preprocessor_pipeline import ImagePreprocessorPipeline
from dataset.preprocessing.image_preprocessors.normalize_image_preprocessor import NormalizeImagePreprocessor
from dataset.preprocessing.labels_preprocessors.label_preprocess_pipeline import LabelPreprocessPipeline
from dataset.preprocessing.labels_preprocessors.one_char_encoder import OneCharEncoder
from dataset.preprocessing.labels_preprocessors.string_encoder import StringEncoder

import sklearn.model_selection


class CaptchaNetwork:
Expand Down
3 changes: 1 addition & 2 deletions src/captcha_detection/test.py → src/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from dataset.preprocessing.image_preprocessors.convert_to_grayscale_preprocessor import ConvertToGrayscalePreprocessor
from dataset.preprocessing.image_preprocessors.resize_preprocessor import ResizePreprocessor
from utils.file_writer import FileWriter

from dataset.preprocessing.image_preprocessors.image_preprocessor_pipeline import ImagePreprocessorPipeline
from dataset.preprocessing.image_preprocessors.normalize_image_preprocessor import NormalizeImagePreprocessor
Expand All @@ -26,7 +25,7 @@
if __name__ == "__main__":
# Parse arguments
parser = argparse.ArgumentParser()
parser.add_argument("--weights_file", default="src/captcha_detection/model.h5", type=str, help="Path to file that contains pre-trained weights.")
parser.add_argument("--weights_file", default="model.h5", type=str, help="Path to file that contains pre-trained weights.")
parser.add_argument("--batch_size", default=32, type=int, help="Batch size.")
parser.add_argument("--out_dir", default="out", type=str, help="Out dir")
parser.add_argument("--captcha_length", default=4, type=int)
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/bin/bash
# this script can be run on cluster using command e.g.: qsub -l mem_free=8G,act_mem_free=8G,h_vmem=12G -cwd -j y sh train.sh
/usr/bin/python3 ./src/captcha_detection/test.py
venv/bin/python3 ./src/test.py --weights_file="src/captcha_detection/model.h5"
7 changes: 2 additions & 5 deletions train.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/bash
# this script can be run on cluster using command e.g.: qsub -l mem_free=8G,act_mem_free=8G,h_vmem=12G -cwd -j y sh train.sh
/usr/bin/python3 ./src/captcha_detection/train.py \
--checkpoint_freq=1 \
--transformed_img_height=60 \
--transformed_img_width=60
venv/bin/python3 src/train.py --weights_file="src/captcha_detection/model.h5" \
--checkpoint_freq=1

0 comments on commit 840f9c1

Please sign in to comment.