python车辆型号识别_深度学习汽车型号识别

Car Recognition

This repository is to do car recognition by fine-tuning ResNet-152 with Cars Dataset from Stanford.

Dependencies

Dataset

We use the Cars Dataset, which contains 16,185 images of 196 classes of cars. The data is split into 8,144 training images and 8,041 testing images, where each class has been split roughly in a 50-50 split.

You can get it from Cars Dataset:

$ cd Car-Recognition

$ wget http://imagenet.stanford.edu/internal/car196/cars_train.tgz

$ wget http://imagenet.stanford.edu/internal/car196/cars_test.tgz

$ wget --no-check-certificate https://ai.stanford.edu/~jkrause/cars/car_devkit.tgz

ImageNet Pretrained Models

Download ResNet-152 into models folder.

Usage

Data Pre-processing

Extract 8,144 training images, and split them by 80:20 rule (6,515 for training, 1,629 for validation):

$ python pre_process.py

Train

$ python train.py

If you want to visualize during training, run in your terminal:

$ tensorboard --logdir path_to_current_dir/logs

Analysis

Update "model_weights_path" in "utils.py" with your best model, and use 1,629 validation images for result analysis:

$ python analyze.py

Validation acc:

88.70%

Confusion matrix:

Test

$ python test.py

Submit predictions of test data set (8,041 testing images) at Cars Dataset, evaluation result:

Test acc:

88.88%

Demo

Download pre-trained model into "models" folder then run:

$ python demo.py --i [image_path]

If no argument, a sample image is used:

$ python demo.py

class_name: Lamborghini Reventon Coupe 2008

prob: 0.9999994

1

2

3

4

Hyundai Azera Sedan 2012, prob: 0.99

Hyundai Genesis Sedan 2012, prob: 0.9995

Cadillac Escalade EXT Crew Cab 2007, prob: 1.0

Lamborghini Gallardo LP 570-4 Superleggera 2012, prob: 1.0

BMW 1 Series Coupe 2012, prob: 0.9948

Suzuki Aerio Sedan 2007, prob: 0.9982

Ford Mustang Convertible 2007, prob: 1.0

BMW 1 Series Convertible 2012, prob: 1.0

Mitsubishi Lancer Sedan 2012, prob: 0.4401

Cadillac CTS-V Sedan 2012, prob: 0.9801

Chevrolet Traverse SUV 2012, prob: 0.9999

Bentley Continental GT Coupe 2012, prob: 0.9953

Nissan Juke Hatchback 2012, prob: 0.9935

Chevrolet TrailBlazer SS 2009, prob: 0.987

Hyundai Accent Sedan 2012, prob: 0.9826

Ford Fiesta Sedan 2012, prob: 0.6502

Acura TL Sedan 2012, prob: 0.9999

Aston Martin V8 Vantage Coupe 2012, prob: 0.5487

Infiniti G Coupe IPL 2012, prob: 0.2621

Ford F-150 Regular Cab 2012, prob: 0.9995

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值