Giter Site home page Giter Site logo

moxel / caffe-colorization Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dummy-ai/colorization

3.0 3.0 1.0 138.54 MB

Automatic colorization using deep neural networks. "Colorful Image Colorization." In ECCV, 2016.

Home Page: http://richzhang.github.io/colorization/

License: BSD 2-Clause "Simplified" License

Python 81.37% Shell 6.66% C++ 8.66% Cuda 3.30%

caffe-colorization's Introduction

Image Colorization in Caffe [Project Page]

Richard Zhang, Phillip Isola, Alexei A. Efros. In ECCV, 2016.

Teaser Image

Before you start

First, make sure that you've installed the latest version of Moxel CLI:

sudo pip install -U moxel

and you have logged in your account:

moxel login

How to upload to Moxel

This repo is deployment-ready: it has the necessary ingredients serve_model.py and moxel.yml. To deploy, just run

moxel push [your-repo]:latest

The following tutorial shows how to create these ingredients.

Step 1. Wrap your model

Wrapping your model is easy. All you need is to load your model into global variables, and write a predict function in serve.py that serves each input request.

import moxel

m = Model()

def predict(img_in):
    img_out = m.predict(img_in.to_numpy())
    return {
        'img_out': moxel.space.Image.from_numpy(img_out)
    }

Make sure that serve.py is tracked with git, because moxel will push your git repo.

git add serve.py

Step 2. Test your model (optional)

To test your model locally, you can use

moxel serve

This will create a HTTP server at 5900, and listen to requests. To send a request, check out test.py

python test.py

Even better, if you have docker installed, you can serve the function in a container, just like production environment.

moxel serve --docker

Step 3. Push your model

Write the moxel.yml config that describes your model, for example,

name: colorization
tag: latest
image: py2-caffe
assets:
- ./models/colorization_deploy_v2.prototxt
- ./models/colorization_release_v2.caffemodel
- ./resources/pts_in_hull.npy
resources:
  memory: 512Mi
  cpu: "1"
input_space:
  img_in: image
output_space:
  img_out: image
setup:
- pip install -r requirements.txt
main:
  type: python
  entrypoint: serve.py::predict

Then just do

moxel push

Your local repo along with assets will be pushed to moxel remote repository. From there, moxel will use the YAML config to deloy this model. A few minutes later, your model is LIVE!

caffe-colorization's People

Contributors

azza-bazoo avatar gfolego avatar phillipi avatar richzhang avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bitcoincode

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.