Code Monkey home page Code Monkey logo

specialization-project-repo's Introduction

Specialization Project

This github repository is created as a supplementary resource to my specialization project conducted during the fall of 2019. The focus of the project was to fine-tune a Faster R-CNN object detection model using the Tensorflow API in order to detect and localize cores within optical core images used in the petroleum industry. This repository presents the results generated by the three models (benchmark, M1, M2) outlined in the project report. Additonally, the weights from the three models and inference graph from the final model (M2) is made available so that they can be trained further, or be used directly for inference.

Alt Text

Appendix

The Appendix directory contains the files and scripts mentioned in Methodology chapter of the report (files), the configuration files for the three models, as well as the data used. The original images are provided in .jpeg format and the labeld data is provided in the formats: .xml, .csv and .tfrecord. Additionally, the predictions on the validation set for the three models and the M2 predictions on test set is presented in predictions_results. Notice that some of the images with the predicted bounding boxes are too large to be previewed on github, and must be downloaded in order to be viewed. The files in the Appendix directory are mainly intented for viewing and not for further use. Thus, the file paths in the configuration files are specific for project structure of the author.

Further Training and Inference

This section requires the user to install Tensorflow and setup the Tensorflow Object Detection Environment, which can be done by following the installation documentation. The following bullet points summarizes the installation steps necessary in order setup the enviornment with links to their locations in the documentation:

setup

  • Install Tensorflow. Both CPU and GPU support is available.
  • Install Tensorflow Models and complete the following steps in the documentation:
    • Install prerequisites
    • Download the TensorFlow models
    • Protobuf installation/compilation
    • Adding necessary Environment Variables
    • COCO API installation
    • Test installation
  • If creating a new dataset, consult the labelImg installation and follow the data processing steps outlined in the project report. Alternatively, follow the documentation according to the following steps:
    • Preparing workspace
    • Annotating images
    • Creating label map
    • Creating TensorFlow records (xml to csv and csv to tfrecord)

further training

The folders benchmark, M1 and M2 are the training directories for three models trained in this project, containing the fine-tuned checkpoints and the model configuration file. When the the Tensorflow object detection environment is installed, these can be downloaded and trained further. Either by using the tfrecords provided in this repository (data) or with new data. Assuming that both Tensorflow and the object detection environment outlined above has been downloaded and setup, the models in this repository can be trained as follows:

  • Download the desired model (e.g. M2) and place this folder within the object_detection directory in models/research
  • Download the (data) directory or alternatively create new data.
  • Change the paths in the configuration file and run the train-evaluation pipeline as outlined in the methodology chapter of the project report.

inference and cropping

The inference graph for the M2 model has been frozen and exported so that inference can be done on new core images, as can be seen in the modified object detection tutorial notebook. The notebook shows inference performed on three optical core images, and the cropped result using the predicted bounding boxes from M2 is saved in the cropped_output folder. The notebook and the inference graph can be downloaded and used to perform inference and cropping with the following steps:

  • Download the inference folder
  • Move the notebook and the M2_inference_graph folder into models/research/object_detection
  • Add the optical core images to perform inference on in models/research/object_detection/M2_inference_graph/image
  • Start jupyter notebook from the object_detection directory
  • Perform inference by running the notebook

specialization-project-repo's People

Contributors

adelved avatar

Watchers

 avatar

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.