Giter Site home page Giter Site logo

captionbot's Introduction

captionbot Build Status

Get captions for image using Microsoft's CaptionBot ๐Ÿค–

๐Ÿค– I think it's a dog in the snow.

Install

$ npm install --save captionbot

Usage

const captionbot = require('captionbot');

captionbot('http://imgur.com/B7a15F5.jpg')
    .then(caption => {
        console.log(caption);
    })

//=> 'I think it's a dog in the snow.'

API

captionbot(imageUrl)

imageUrl

Type: string

Url to the image. Must be on a public server that Microsoft's servers can download to determine the caption.

Returns a promise for the caption.

Notes

  • Requires Node 4 or newer.
  • Powered by CaptionBot, a free service provided by Microsoft.
  • If you like this, you can read more at https://www.microsoft.com/cognitive-services.
  • This node module was not created by Microsoft.
  • I would consider this module "for testing only" - I do not recommend using in a production system.
  • Microsoft: I made this because I am a fan of the technology. If there are any problems, or you want to use this package name, I'm happy to discuss.

License

MIT ยฉ Dylan Greene

captionbot's People

Contributors

dylang avatar hemanth 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

captionbot's Issues

It does not work

Error message
ee.emit('error', new got.RequestError(err, opts));
^
ErrorClass [RequestError]: getaddrinfo ENOTFOUND www.captionbot.ai
at ClientRequest. (/.../.../.../node_modules/got/index.js:73:21)
at Object.onceWrapper (node:events:629:26)
at ClientRequest.emit (node:events:514:28)
at TLSSocket.socketErrorListener (node:_http_client:501:9)
at TLSSocket.emit (node:events:514:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'ENOTFOUND',
host: 'www.captionbot.ai',
hostname: 'www.captionbot.ai',
method: 'GET',
path: '/api/init'
}

Node.js v18.17.0

SyntaxError: Unexpected end of JSON input

SyntaxError: Unexpected end of JSON input
    at Object.parse (native)
    at got.then.then.response (/Users/shawnmiller/GitHub/mehdown/node_modules/captionbot/index.js:36:26)
    at process._tickCallback (internal/process/next_tick.js:103:7)

Looks like captionbot is returning an empty response. Any ideas?

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.