Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jianlizh429/dog_vs_cat
https://github.com/jianlizh429/dog_vs_cat
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/jianlizh429/dog_vs_cat
- Owner: JianliZh429
- License: mit
- Created: 2018-08-28T01:31:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-05T01:31:51.000Z (over 6 years ago)
- Last Synced: 2024-04-14T03:50:27.014Z (9 months ago)
- Language: Python
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dog VS Cat
Kaggle competition: Dogs vs. Cats Redux: Kernels Edition## Usage
### Format dataset
Format the dataset to the architecture that fit keras
```text
data/
train/
dogs/
dog001.jpg
dog002.jpg
...
cats/
cat001.jpg
cat002.jpg
...
validation/
dogs/
dog001.jpg
dog002.jpg
...
cats/
cat001.jpg
cat002.jpg
...
```**$dog_vs_cat_dataset_dir**: path of train directory in the dog vs cat dataset downloaded from kaggle, after you unzip the all.zip
**$target_dir**: the directory where you want to put your output
```shell
python train/format_dataset.py $dog_vs_cat_dataset_dir $target_dir --val_ratio 0.1
```### training
- train ResNet50
```shell
python train/train_resnet50.py $train_dataset_dir $validation_dataset_dir --batch_size 256 --epochs 100 --lr 0.001
```
- train ResNet50 with center loss
```shell
python train/train_resnet50_with_center_loss.py $train_dataset_dir $validation_dataset_dir --batch_size 256 --epochs 100 --lr 0.001
```- train InceptionResNetV2 with center loss
```shell
python train/train_inception_resnet_v2.py $train_dataset_dir $validation_dataset_dir --batch_size 256 --epochs 100 --lr 0.001
```### evaluate
$test_dataset_dir: path of test dataset directory of kaggle dog vs cat dataset```shell
python train/evaluate.py weights_file_path $test_dataset_dir --out_dir $out_dir
```