/fastai-rails

Primary LanguageJupyter Notebook

fastai-rails - a docker setup for serving a deep learning model with a front-end component

Steps to get up and running:

  1. Install docker and docker-compose
  2. Clone repository and cd into it
  3. Run docker-compose up and wait for the images to be built
  4. Navigate to localhost in your browser

The frontend is a rails application. The API endpoint runs on starlette.

This is a minimal setup created for demonstration purposes. The files of interest are:

  • upload.html.erb - image upload form rendered when navigating to localhost
  • images_controller.rb - rails controller handling the logic of reaching out to the API endpoint
  • api.py - entire starlette app for the API endpoint
  • show_results.html.erb - template file for rendering the results to the user
  • pets.ipynb - a jupyter notebook for training and saving the model

I recorded a walkthrough where I follow a request starting with a user uploading an image to displaying the results.