Git Product home page Git Product logo

nannernest's Introduction

nannernest

Python package

A small package for optimizing banana coverage on peanut butter and banana sandwiches. See blog post for more info.

assets/perfect_sandwich.jpg

Installation

Python 3.7+ is required.

nannernest is generally pip installable. Due to some C dependencies with the nesting library that I use nest2D, along with an outstanding PR, I would recommend the following way to install everything:

First, make sure you have boost and cmake installed. If you are on Linux, then you may have cmake installed, and you can install boost with

sudo apt-get install libboost-all-dev 

I'm on a Mac, and I installed cmake with conda and boost with brew:

conda install cmake
brew install boost

Next, pip install my fork of nest2D:

pip install git+https://github.com/EthanRosenthal/nest2D.git@download-dependencies

Finally, pip install nannernest

pip install nannernest

Usage

Take a top-down picture that contains your banana and at least one slice of bread. Pass the image in via command line:

$ nannernest my_image.jpg

CLI Details

$ nannernest --help
Usage: nannernest [OPTIONS] IMAGE_PATH

Arguments:
  IMAGE_PATH  Image file which contains bread and banana  [required]

Options:
  --num-slices INTEGER            Total number of slices to cut the banana
                                  into. This number defines the slice
                                  thickness.  [default: 22]

  --mask-threshold FLOAT          Threshold of segmentation mask.  [default:
                                  0.6]

  --peel-scaler FLOAT             Fraction of slice that is assumed to belong
                                  to banana insides versus the peel.
                                  [default: 0.8]

  --ellipse-ratio FLOAT           Assumed ratio of minor axis to major axis of
                                  banana slice ellipses  [default: 0.85]

  --plot-segmentation / --no-plot-segmentation
                                  Whether or not to plot the segmentation
                                  masks  [default: False]

  --plot-slicing / --no-plot-slicing
                                  Whether or not to plot the slicing circle
                                  and skeleton  [default: False]

  --output TEXT                   Name of file to output  [default:
                                  perfect_sandwich.jpg]

nannernest's People

Contributors

dependabot[bot] avatar ethanrosenthal avatar fiddlerwoaroof avatar

Watchers

 avatar  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.