A TensorFlow implementation of VGG networks for image classification
src/nets/vgg.py
.examples/vgg_pretrained.py
.examples/vgg_cifar.py
.For testing the pre-trained model
For training from scratch on CIFAR-10
examples/vgg_pretrained.py
: VGG_PATH
is the path for pre-trained vgg model. DATA_PATH
is the path to put testing images.Go to examples/
and put test image in folder DATA_PATH
, then run the script:
python vgg_pretrained.py --im_name PART_OF_IMAGE_NAME
--im_name
is the option for image names you want to test. If the testing images are all png
files, this can be png
. The default setting is .jpg
.examples/vgg_cifar.py
: DATA_PATH
is the path to put CIFAR-10. SAVE_PATH
is the path to save or load summary file and trained model.examples/
and run the script:
python vgg_cifar.py --train \
--lr LEARNING_RATE \
--bsize BATCH_SIZE \
--keep_prob KEEP_PROB_OF_DROPOUT \
--maxepoch MAX_TRAINING_EPOCH
SAVE_PATH
. One pre-trained model on CIFAR-10 can be downloaded from here.Go to examples/
and put the pre-trained model in SAVE_PATH
. Then run the script:
python vgg_cifar.py --eval \
--load PRE_TRAINED_MODEL_ID
104
, which indicates the one I uploaded. Data Source | Image | Result |
|:—|:—:|:—|
COCO || 1: probability: 1.00, label: brown bear, bruin
2: probability: 0.00, label: American black bear, black bear
3: probability: 0.00, label: ice bear, polar bear
4: probability: 0.00, label: sloth bear, Melursus ursinus
5: probability: 0.00, label: chow, chow chow
COCO || 1: probability: 0.61, label: street sign
2: probability: 0.27, label: traffic light, traffic signal, stoplight
3: probability: 0.02, label: mailbox, letter box
4: probability: 0.02, label: parking meter
5: probability: 0.01, label: pay-phone, pay-station
COCO ||1: probability: 0.48, label: passenger car, coach, carriage
2: probability: 0.36, label: trolleybus, trolley coach, trackless trolley
3: probability: 0.10, label: minibus
4: probability: 0.02, label: school bus
5: probability: 0.01, label: streetcar, tram, tramcar, trolley, trolley car
COCO ||1: probability: 0.17, label: burrito
2: probability: 0.13, label: plate
3: probability: 0.10, label: Dungeness crab, Cancer magister
4: probability: 0.06, label: mashed potato
5: probability: 0.06, label: guacamole
ImageNet ||1: probability: 1.00, label: goldfish, Carassius auratus
2: probability: 0.00, label: rock beauty, Holocanthus tricolor
3: probability: 0.00, label: anemone fish
4: probability: 0.00, label: coral reef
5: probability: 0.00, label: puffer, pufferfish, blowfish, globefish
Self Collection | |1: probability: 0.33, label: tabby, tabby cat
2: probability: 0.20, label: Egyptian cat
3: probability: 0.11, label: tiger cat
4: probability: 0.03, label: Cardigan, Cardigan Welsh corgi
5: probability: 0.02, label: bookcase
Self Collection | |1: probability: 1.00, label: streetcar, tram, tramcarr
2: probability: 0.00, label: trolleybus, trolley coach
3: probability: 0.00, label: passenger car, coach, carriage
4: probability: 0.00, label: electric locomotive
5: probability: 0.00, label: minibus
learning curve for training set
learning curve for testing set
Qian Ge