GithubHelp home page GithubHelp logo

car-recognition's Introduction

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.

image

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

image

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:

image

Test

$ python test.py

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

Test acc:

88.88%

image

Demo

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

$ python demo.py --i [image_path]

If no argument, a sample image is used:

image

$ python demo.py
class_name: Lamborghini Reventon Coupe 2008
prob: 0.9999994
1 2 3 4
image image image image
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
image image image image
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
image image image image
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
image image image image
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
image image image image
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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.