Giter Club home page Giter Club logo

object-detection-using-cnn's Introduction

Simple Object Detection using Convolutional Neural Network

Object detection is one of the fundamental problem in computer vision. Given an image, the goal is to detect the objects within the image, by generating a rectangular box (bounding box) around the objects. Obviously, there can be multiple objects in an image of same or different classes. Object detection deals with identifying each of these objects. However, in this project we are just concerned with a single object detection.

Model Architecture

Our model consists of three convolutional layers and two fully connected layers. A kernel of size 5 with stride 1 is used in each of the convolutional layers and rectified linear units, ReLU, is used as activation function. A max pooling layer of filter size 2 with stride 2 is employed after each of the first two convolutional layers.

Training

We have trained the network for 50 epoch using stochastic gradient descent (SGD). For the first 30 epoch, the learning rate is set to 0.000001 and after that it is reduced to 0.0000001. We have also employed a momentum of 0.9. For regularization, dropout (with p=0.5) is used.

Dataset

The dataset we have used here is very simple and is generated in python. Each image is 100x100x1 and has a small rectangular box of random size and shape and at random positions. For background the color value is set to 0 and for box it is set to 255. The training dataset has 1000 of such images and the test dataset consists of 200 images. The corresponding ground truth information are stored in separate file.

To use the pretrained model, download the trained model from this link.

object-detection-using-cnn's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

object-detection-using-cnn's Issues

multiple classes

how do i prepare the dataset to train this cnn on if i have many labels/classes associated with each image? how will my x_train and y_train be obtained in that case? I have multiple images with multiples classes each and annotations are present in json format for each image.

Can anyone please help me resolve this error.

FileNotFoundError Traceback (most recent call last)
in
16 model = cnn_model()
17 model.eval()
---> 18 model.load_state_dict(torch.load('Model/cnn_model.pth'))
19
20

2 frames
/usr/local/lib/python3.7/dist-packages/torch/serialization.py in init(self, name, mode)
209 class _open_file(_opener):
210 def init(self, name, mode):
--> 211 super(_open_file, self).init(open(name, mode))
212
213 def exit(self, *args):

FileNotFoundError: [Errno 2] No such file or directory: 'Model/cnn_model.pth'

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.