Coder Social home page Coder Social logo

twocngdagz / altify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from parhamp/altify

0.0 2.0 0.0 383 KB

Uses deep learning to caption images in an HTML file and fills out its alternative text attributes with the related caption

License: Apache License 2.0

Python 100.00%

altify's Introduction

Altify

image

Altify automizes the task of inserting alternative text attributes for image tags. Altify uses Microsoft Computer Vision API's deep learning algorithms to caption images in an HTML file and returns a new HTML file in which alt attributes are filled out with their corresponding captions.

Notice: Altify will now ignore any image tag whose alt attribute has content or is just an empty string. (In compliance with standard web practices)

Dependencies

  • Python 2.7
  • BeautifulSoup

Install and Usage (Latest Version)

1) Get a Microsoft API Key for Free

https://www.microsoft.com/cognitive-services/en-us/sign-up.

2) Install via pip

Open up terminal and enter: pip install altify

3) Use

altify path_to_your_html api_key

4) Enjoy!

A new HTML file called altify.html is created next to the HTML file you selected.

How It was Built

  1. Parses the html using BeautifulSoup.
  2. Finds all the image tags.
  3. Sends a request to Microsoft's API to caption.
  4. Fills out the alt attributes for all the images.
  5. Writes an edited HTML file next to the file you selected.

Captioned Images Samples

image

Donald Trump wearing a suit and tie

image

A piano keyboard

image

A squirrel eating

image

A close up of a cat looking at the camera

image

A woman wearing a red hat

image

A small boat in a lake surrounded by mountains

Disclaimer

Humans are currently better at captioning images than machines. Use responsibly!

altify's People

Contributors

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