GithubHelp home page GithubHelp logo

codait / magicat Goto Github PK

View Code? Open in Web Editor NEW
24.0 27.0 4.0 13.21 MB

๐Ÿง™๐Ÿ˜บ magicat - Deep learning magic.. with the convenience of cat!

License: Apache License 2.0

JavaScript 100.00%
deep-learning computer-vision cli-utilities image-segmentation image-recognition

magicat's People

Contributors

dependabot[bot] avatar kastentx avatar ptitzler avatar vabarbosa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magicat's Issues

Using in my nose js app

Hi!

Is it possible to use magicat in my own node js app without the cli tool. To automatically remove backgrounds from uploaded images?

Thanks in advance!

Abort trap: 6

Platform: Mac running MacOS 10.14.1 (latest), Node.js v8.11.1

Having installed with npm,

$ npm install -g magicat
/usr/local/bin/magicat -> /usr/local/lib/node_modules/magicat/app.js
+ [email protected]
updated 1 package in 14.014s

if I run

$ magicat myimage.jpg

(on any image), I get:

dyld: lazy symbol binding failed: Symbol not found: __ZN2v87Isolate19CheckMemoryPressureEv
  Referenced from: /usr/local/lib/node_modules/magicat/node_modules/canvas/build/Release/canvas.node
  Expected in: flat namespace

dyld: Symbol not found: __ZN2v87Isolate19CheckMemoryPressureEv
  Referenced from: /usr/local/lib/node_modules/magicat/node_modules/canvas/build/Release/canvas.node
  Expected in: flat namespace

Abort trap: 6

I get the same output with magicat --help.

it's a trap

Improve error output for invalid input images

One of my directories contains a number of files with a jpg or png extension.

magicat ~/Downloads/
Scanning directory '/Users/patti/Downloads'...

error building response map - error preprocessing image - Error: Could not find MIME for Buffer <null>

Turns out, one of the files, e.g. abc.jpg, wasn't an actual image but a text document. It took me a while to figure out which file was causing the issue. If an error is raised the message should identify the image that was causing it, to make it easier to troubleshoot in situations where magicat is used to process a large collection of images.

Error Installing on WSL

Running in WSL (2, on Windows 10) as admin. Anyone else run into this?

cutups@cutups-PC:/mnt/c/Windows/System32$ sudo npm install -g magicat
npm WARN deprecated @babel/[email protected]: ๐Ÿšจ As of Babel 7.4.0, this
npm WARN deprecated package has been deprecated in favor of directly
npm WARN deprecated including core-js/stable (to polyfill ECMAScript
npm WARN deprecated features) and regenerator-runtime/runtime
npm WARN deprecated (needed to use transpiled generator functions):
npm WARN deprecated
npm WARN deprecated   > import "core-js/stable";
npm WARN deprecated   > import "regenerator-runtime/runtime";
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
/usr/bin/magicat -> /usr/lib/node_modules/magicat/app.js

> @tensorflow/[email protected] install /usr/lib/node_modules/magicat/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-linux-1.2.8.tar.gz
Faile to update addon name in package.json: Error: EACCES: permission denied, open '/usr/lib/node_modules/magicat/node_modules/@tensorflow/tfjs-node/scripts/../package.json'
(node:412) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/magicat/node_modules/@tensorflow/tfjs-node/deps'
(node:412) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:412) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

> [email protected] install /usr/lib/node_modules/magicat/node_modules/canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/lib/node_modules/magicat/node_modules/canvas/build'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/magicat/node_modules/canvas/build'
gyp ERR! System Linux 4.4.0-17134-Microsoft
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/lib/node_modules/magicat/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/usr/lib/node_modules/magicat/node_modules/canvas/build/Release" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /usr/lib/node_modules/magicat/node_modules/canvas
gyp ERR! node -v v12.8.1
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/lib/node_modules/magicat/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/usr/lib/node_modules/magicat/node_modules/canvas/build/Release --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/magicat/node_modules/canvas/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:203:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Linux 4.4.0-17134-Microsoft
node-pre-gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/magicat/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/lib/node_modules/magicat/node_modules/canvas
node-pre-gyp ERR! node -v v12.8.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/lib/node_modules/magicat/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/usr/lib/node_modules/magicat/node_modules/canvas/build/Release --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cutups/.npm/_logs/2019-08-24T23_13_40_092Z-debug.log
cutups@cutups-PC:/mnt/c/Windows/System32$

Strange results

I see a strange result when I run magicat dog-human.jpg --show dog on the file in the MAX-Object-Detector assets directory.

image

The image looks normal when I run it directly though MAX-Image-Segmenter.
image

magical cannot handle absolute path names

$ magicat --version 
1.5.2

Relative path spec: OK

$ magicat ../max/MAX-Image-Segmenter-Web-App/assets/
Scanning directory '/Users/patti/think/../max/MAX-Image-Segmenter-Web-App/assets'...

The image 'airplane.jpg' contains the following segments: background, airplane.
The image 'aurora borealis.jpg' contains the following segments: background.
...

Absolute path spec: FAIL

$ magicat /Users/patti/max/MAX-Image-Segmenter-Web-App/assets/
Scanning directory '/Users/patti/max/MAX-Image-Segmenter-Web-App/assets'...

error building response map - error preprocessing image - Error: ENOENT: no such file or directory, open '/Users/patti/think//Users/patti/max/MAX-Image-Segmenter-Web-App/assets/airplane.jpg'

help! help is broken

$ magicat --version
1.5.2

OK, but note the help option.

$ magicat

๐Ÿง™๐Ÿ˜บ magicat

  A Deep Learning powered CLI utility for identifying the contents of image     
  files. Your very own command-line crystal ball ๐Ÿ”ฎ.                             

Synopsis

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

FAIL (notice --help syntax, no help output and [boolean] output)

$ magicat help
Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                         [boolean]

FAIL (notice --help syntax, no help output and [boolean] output)

$ magicat --help
Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                         [boolean]

OK.

$ mahgicat -h
-bash: mahgicat: command not found
bigmac:think patti$ magicat -h

๐Ÿง™๐Ÿ˜บ magicat

  A Deep Learning powered CLI utility for identifying the contents of image     
  files. Your very own command-line crystal ball ๐Ÿ”ฎ.                             

Synopsis

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

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.