cntk-hotel-pictures-classificator | using CNTK 2.1 to train model | Computer Vision library
kandi X-RAY | cntk-hotel-pictures-classificator Summary
kandi X-RAY | cntk-hotel-pictures-classificator Summary
This POC is using CNTK 2.1 to train model for multiclass classification of images. Our model is able to recognize specific objects (i.e. toilet, tap, sink, bed, lamp, pillow) connected with picture types we are looking for. It plays a big role in a process which will be used to classify pictures from different hotels and determine whether it's a picture of bathroom, bedroom, hotel front, swimming pool, bar, etc. That final classification will be made based on objects that were detected in those pictures.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Calculate the prediction for the given bottom box
- Compute the target sizes
- Unmap data
- Train the FASNN alternative model
- Compute rpn_proto_probs
- Clone a model
- Clone the convolution layer
- Calculate the predictions based on the input arguments
- Compute nms of dets
- Set global variables
- Forward computation
- Evaluate a faster RNN model
- Evaluate the model and plot the results
- Calls the cv2 event handler
- Set up the layers
- Generate anchors
- Train a FasterRNN prediction model
- Download the dataset
- Download a model by name
- Read image from file
- Generate list of anchors
- Draw text using cv2
- Compute the overlap between this bounding box
- Crop a list of bounding boxes
- Return the width of the draw text
- Create mappings
- Set up the layer
cntk-hotel-pictures-classificator Key Features
cntk-hotel-pictures-classificator Examples and Code Snippets
Community Discussions
Trending Discussions on cntk-hotel-pictures-classificator
QUESTION
I have just set up a new Data Science Virtual Machine on Azure. I wanted to run a script FasterRCNN.py from https://github.com/karolzak/CNTK-Hotel-pictures-classificator but received an error:
from utils.rpn.rpn_helpers import create_rpn, create_proposal_target_layer
ImportError: No module named 'utils.rpn'
The environment I am running the script on has Python 3.4 and CNTK 2.1 installed.
I tried to add a Detection or Detection/utils directories (by editing ~./bashrc) to PYTHONPATH:
export PYTHONPATH="$PYTHONPATH:/home/username/CNTK-Hotel-pictures-classificator/Detection"
as described in https://github.com/Microsoft/CNTK/issues/2705 but the error persists.
Update: Screenshot
...ANSWER
Answered 2018-Feb-03 at 22:26If anyone is struggling:
the solution to that problem is creating an empty __init__.py
file in utils
directory.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cntk-hotel-pictures-classificator
Setup Python environment In order for scripts to work you should have a proper Python environment. If you don't already have it setup then you should follow one of the online tutorials. To setup Python environment and all the dependencies required by CNTK on my local Windows machine, I used scripted setup tutorial for Windows. If you're using Linux then you might want to look into one of these tutorials. Just bear in mind that this project was developed and tested with CNTK 2.1 and it wasn't tested for any other version. Even after setting up Python environment properly you might still witness some errors when running Python scripts. Most of those errors are related to missing modules or some 3rd party frameworks and tools (i.e. GraphViz). Missing modules can be easily pip installed and most of the required ones can be found in requirements.txt files for each folder with Python scripts. Please report if you'll find any errors or missing modules, thanks!
Download hotel pictures dataset (HotailorPOC2) and pretrained AlexNet model used for Transfer Learning Go to Detection/FasterRCNN folder in the location were you unzipped this repo and run install_data_and_model.py. It will automatically download the HotailorPOC2 dataset, pretrained AlexNet model and will generate mapping files required to train the model.
Follow steps number 1 and 2 from setup instructions.
In order to train the model we use transfer learning and we need to have a pretrained model for that. For this sample we use AlexNet model.
Make sure to change variables in your config.py file and make sure you set __C.CNTK.MAP_FILE_PATH variable to a proper directory: if __C.CNTK.DATASET == "HotailorPOC2": #name of your dataset. Must match the name set with property '__C.CNTK.DATASET' __C.CNTK.MAP_FILE_PATH = "../../DataSets/HotailorPOC2" # your dataset directory __C.CNTK.NUM_TRAIN_IMAGES = 82 # number of images in 'positive' folder __C.CNTK.NUM_TEST_IMAGES = 20 # number of images in 'testImages' folder __C.CNTK.PROPOSAL_LAYER_PARAMS = "'feat_stride': 16\n'scales':\n - 4 \n - 8 \n - 12"
Open install_data_and_model.py script and comment out those lines: #downloads hotel pictures classificator dataset (HotailorPOC2) #comment out lines bellow if you're using a custom dataset sys.path.append(os.path.join(base_folder, "..", "..", "DataSets", "HotailorPOC2")) from download_HotailorPOC2_dataset import download_dataset download_dataset()
Run install_data_and_model.py script. Bear in mind that downloading the pretrained model may take few minutes or even more depending on your internet connection.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page