-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from baldassarreFe/feature/typos
Feature/typos
- Loading branch information
Showing
13 changed files
with
112 additions
and
55 deletions.
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 |
---|---|---|
|
@@ -101,4 +101,4 @@ resized | |
|
||
py36 | ||
py37 | ||
imagenet | ||
imagenet |
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
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
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
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,28 +1,50 @@ | ||
# Testing | ||
|
||
<!-- **Note:** Running the tests together fails due to some internal TensorFlow problem, avoid running: --> | ||
All commands must to be run at repository folder level. | ||
|
||
### Run all tests | ||
Before running any test, generate a sample dataset (see below). | ||
|
||
### Table of contents | ||
|
||
- [Prepare sample dataset](#prepare-sample-dataset) | ||
- [Run tests](#run-tests) | ||
- [Run all tests](#run-all-tests) | ||
- [Run specific module tests](#run-specific-module-tests) | ||
|
||
## Prepare sample dataset | ||
|
||
The sample dataset is generated using the [unsplash.txt](../data/unsplash.txt) file. Run | ||
|
||
```bash | ||
bash tests/prepare-sample-dataset.sh | ||
``` | ||
|
||
which places the sample dataset in folder folder [tests/data](data). | ||
|
||
## Run tests | ||
|
||
### Run all tests | ||
|
||
You can run all tests by using | ||
|
||
```bash | ||
python3.6 -m unittest discover tests -v | ||
python -m unittest discover tests -v | ||
``` | ||
|
||
> **Note:** `test_colorization.py` will train a simple model for 20 epochs, might take few seconds. | ||
### Run specific module tests | ||
### Run specific module tests | ||
|
||
You can run single test cases | ||
|
||
```bash | ||
python3.6 -m unittest -v \ | ||
python -m unittest -v \ | ||
tests/batching/test_write_read_base.py \ | ||
tests/batching/test_write_read_variable.py | ||
``` | ||
|
||
Or run them individually: | ||
```bash | ||
python3.6 -m tests.batching.test_write_read_single_image -v | ||
python -m tests.batching.test_write_read_single_image -v | ||
``` |
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
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
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
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
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
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
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,8 @@ | ||
# Ignore everything in this directory | ||
original/* | ||
resized/* | ||
tfrecords/* | ||
inception_resnet_v2_2016_08_30.ckpt | ||
|
||
# Except these files | ||
!resized |
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,14 @@ | ||
# If following paths are changed, make sure to change scripts in ./tests/batching/ accordingly | ||
UNSPASH_URLS='./data/unsplash.txt' | ||
DIR_ORIGINAL='./tests/data/original/' | ||
DIR_RESIZED='./tests/data/resized/' | ||
DIR_TFRECORDS='./tests/data/tfrecords' | ||
CHECKPOINT_INCEPTION='./data/inception_resnet_v2_2016_08_30.ckpt' | ||
|
||
echo "1/3 Downloading unsplash images" | ||
python -m koalarization.dataset.download ${UNSPASH_URLS} ${DIR_ORIGINAL} | ||
echo "2/3 Resizing images" | ||
python -m koalarization.dataset.resize ${DIR_ORIGINAL} ${DIR_RESIZED} | ||
echo "3/3 Generating TF Records" # Assumes inception checkpoint is placed in ./data | ||
python -m koalarization.dataset.lab_batch -c ${CHECKPOINT_INCEPTION}\ | ||
${DIR_RESIZED} ${DIR_TFRECORDS} |