Skip to content

ganeshkumartk/whatami

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


whatami
๐Ÿ˜Ž 'whatami' npm version

Find Whatsoever in image with the convenience of Machine learning at CLI!

Basic usage

At it's core, whatami is a tool that allows you to identify the objects contained in an image file.

It does this by leveraging the power of the MAX Image Segmenter model, one of the many free-to-use, open-source deep learning models available on IBM's Model Asset eXchange. The model has been converted to a TensorFlow.js implementation and the app runs entirely in Node.js.

In addition to displaying an image's contents, whatami has extended this functionality by offering several commands that allow you to search over directories with multiple images for certain objects, save individual objects as new image files, show in-terminal previews of objects, and more.

Installation Instructions

Install using npm to automatically add the whatami command to your PATH.

$ npm i -g whatami

That's it!

Now you can begin using whatami like your very own command-line crystal ball ๐Ÿ”ฎ to identify what objects are contained in an image.

Prerequisites

  • Node.js v10.x or higher. Install from here.

Basic Commands

Keep reading for quick-and-easy install instructions, some information on the basic commands that are available and some GIFs to help you get started.

Use the basic command whatami </path/image_name> to identify what objects are contained in an image. If you have multiple images you'd like to inspect, you can also provide the name of a directory containing image files.

To scan a directory of images for a certain object, use the --contains command. When used in combination with the --verbose option, the results for all images in a directory will be displayed.

If you'd like to see an in-terminal preview of any of these objects, use the --show flag, followed by the name of the object you'd like to see. You can specify the 'colormap' to see all the objects highlighted within the original image.

To save any of the objects as individual image files, use the --save flag, followed by the name of the object you'd like to save, or use 'all' to save all objects.

To remove an object or background from an image, use the --remove flag, followed by the name of the object you'd like to remove or the shorthand aliases 'bg' or 'BG' to remove the background.

For more detailed usage information, see the in-app help page which can be accessed by executing whatami -h

Synopsis

$ whatami <file> [--command]      
$ whatami <directory> [--command] 
$ whatami [--help | -h]  

Command List

Commands Usage
save <object> Save the specfied object to it's own file. Also works with 'all'.
remove <object> Save a copy of the image with the specfied object (or background) removed. Supports aliases 'bg' and 'BG'.
show <object> Show the specified object (or the entire image if blank) in the terminal.
contains object [--verbose] Returns list of images containing the specified object. (Use --verbose option to see all results).

Examples

  1. Examine objects contained in an image.
$ whatami path/to/IMAGE.PNG
  1. Show the 'dining table' from sample.jpg.
$ whatami sample.jpg --show 'dining table'
  1. Scan the 'pets' directory for images containing a dog.
$ whatami pets/ --contains Dog          
  1. Remove the background from all images in the current directory.
$ whatami . --remove BG

Detectable Objects

Objects Objects
Airplane Dining Table
Bicycle Dog
Bird Horse
Boat Motorbike
Bottle Person
Bus Potted Plant
Car Sheep
Cat Sofa
Chair Train
Cow TV

Licenses

Component License Link
This repository Apache 2.0 LICENSE
Model Code (3rd party) Apache 2.0 TensorFlow Models Repository
Model Weights Apache 2.0 TensorFlow Models Repository