



This is the model for [https://github.com/hasu234/SDPDSSample](https://github.com/hasu234/SDPDSSample). this repository. 

This classifier can classify between ```dog```, ```berry```, ```flower``` and ```bird``` images.
![Sample Dataset](images/dataset.png)



## Dependencies

* Python 3.9

## Setting up  conda Environment

* Clone the repository by running 
```
git clone https://github.com/hasu234/SDPDSSample.git
```
* Change current directory to SDPDSSample 
```
cd SDPDSSample
```
* Create a conda environmet 
```
conda create -n myenv python=3.9
```
* Activate the environment 
```
conda activate myenv
```
* Install the required library from ```requirment.txt``` by running 
```
pip install -r requirmen.txt
```
* Or, create a conda environment from ```environment.yml``` by running 
```
conda env create -f environment.yml
```

## Trining your data
* To train your own dataset
Make sure you have a data folder having the same folder hiararchy like below
```
├── dataset
|   ├── train
│   │   ├── class1
│   │   │   ├──image1.jpg
│   │   │   ├──image2.jpg
│   │   ├── class2
│   │   │   ├──image1.jpg
│   │   │   ├──image2.jpg
│   │   ├── class3
│   │   │   ├──image1.jpg
│   │   │   ├──image2.jpg
│   │   ├── class4
│   │   │   ├──image1.jpg
│   │   │   ├──image2.jpg
|   ├── test
│   │   ├── class1
│   │   │   ├──image1.jpg
│   │   │   ├──image2.jpg
│   │   ├── class2
│   │   │   ├──image1.jpg
│   │   │   ├──image2.jpg
│   │   ├── class3
│   │   │   ├──image1.jpg
│   │   │   ├──image2.jpg
│   │   ├── class4
│   │   │   ├──image1.jpg
│   │   │   ├──image2.jpg
```
or make some chainges on ```train.py``` according to to your dataset directory.
* Make sure you are in the project directory and run the ```train.py``` script with the folder directory of your dataset
```
python train.py /path/to/dataset_directory
```
## Running inference
* To run the inference on your test data make sure you downloaded the pretrained model from [this link](https://drive.google.com/uc?id=197Kuuo4LhHunYLgGKfGeouNTL0WguP0T&export=download).
* Then run the ```infer.py``` script from terminal specifying the test image location and downloaded pretrained model location
```
python infer.py path/to/image.jpg path/to/model.pth
```


## Running on Docker
* Clone the repository by running 
```
git clone https://github.com/hasu234/SDPDSSample.git
```
* Change current directory to SDPDSSample 
```
cd SDPDSSample
```
Before Building the docker image transfer the files (model, test image, dataset) to current working directory if you don't want to deal with docker volume
* Build the Docker image by running 
```
docker build -t sdpdsample .
```
* Run the docker image 
```
docker run -d sdpdsample
```
if the container failed to run in background, run it on foreground using ```docker run -it sdpdsample``` then exit to get the running container id
* Get the container id
```
docker ps
```
* Getting inside the container
```
docker exec -it <container id> bash
```
You will get a Linux like command-line interface
* Running the project
```
# for training your data
python train.py /path/to/dataset_directory

# for running inference
python infer.py path/to/image.jpg path/to/model.pth
```
{"language": ["en"], "license": "apache-2.0", "pipeline_tag": "image-classification"}
image-classification en license:apache-2.0 region:us
TAGS
#image-classification #en #license-apache-2.0 #region-us 





This is the model for URL this repository. 

This classifier can classify between , ,  and  images.
!Sample Dataset



## Dependencies

* Python 3.9

## Setting up  conda Environment

* Clone the repository by running 

* Change current directory to SDPDSSample 

* Create a conda environmet 

* Activate the environment 

* Install the required library from  by running 

* Or, create a conda environment from  by running 


## Trining your data
* To train your own dataset
Make sure you have a data folder having the same folder hiararchy like below

or make some chainges on  according to to your dataset directory.
* Make sure you are in the project directory and run the  script with the folder directory of your dataset

## Running inference
* To run the inference on your test data make sure you downloaded the pretrained model from this link.
* Then run the  script from terminal specifying the test image location and downloaded pretrained model location



## Running on Docker
* Clone the repository by running 

* Change current directory to SDPDSSample 

Before Building the docker image transfer the files (model, test image, dataset) to current working directory if you don't want to deal with docker volume
* Build the Docker image by running 

* Run the docker image 

if the container failed to run in background, run it on foreground using  then exit to get the running container id
* Get the container id

* Getting inside the container

You will get a Linux like command-line interface
* Running the project

## Dependencies

* Python 3.9 ## Setting up  conda Environment

* Clone the repository by running 

* Change current directory to SDPDSSample 

* Create a conda environmet 

* Activate the environment 

* Install the required library from  by running 

* Or, create a conda environment from  by running ## Trining your data
* To train your own dataset
Make sure you have a data folder having the same folder hiararchy like below

or make some chainges on  according to to your dataset directory.
* Make sure you are in the project directory and run the  script with the folder directory of your dataset ## Running inference
* To run the inference on your test data make sure you downloaded the pretrained model from this link.
* Then run the  script from terminal specifying the test image location and downloaded pretrained model location ## Running on Docker
* Clone the repository by running 

* Change current directory to SDPDSSample 

Before Building the docker image transfer the files (model, test image, dataset) to current working directory if you don't want to deal with docker volume
* Build the Docker image by running 

* Run the docker image 

if the container failed to run in background, run it on foreground using  then exit to get the running container id
* Get the container id

* Getting inside the container

You will get a Linux like command-line interface
* Running the project
TAGS
#image-classification #en #license-apache-2.0 #region-us 
 ## Dependencies

* Python 3.9 ## Setting up  conda Environment

* Clone the repository by running 

* Change current directory to SDPDSSample 

* Create a conda environmet 

* Activate the environment 

* Install the required library from  by running 

* Or, create a conda environment from  by running ## Trining your data
* To train your own dataset
Make sure you have a data folder having the same folder hiararchy like below

or make some chainges on  according to to your dataset directory.
* Make sure you are in the project directory and run the  script with the folder directory of your dataset ## Running inference
* To run the inference on your test data make sure you downloaded the pretrained model from this link.
* Then run the  script from terminal specifying the test image location and downloaded pretrained model location ## Running on Docker
* Clone the repository by running 

* Change current directory to SDPDSSample 

Before Building the docker image transfer the files (model, test image, dataset) to current working directory if you don't want to deal with docker volume
* Build the Docker image by running 

* Run the docker image 

if the container failed to run in background, run it on foreground using  then exit to get the running container id
* Get the container id

* Getting inside the container

You will get a Linux like command-line interface
* Running the project