You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by Apache Wiki <wi...@apache.org> on 2017/11/22 03:56:23 UTC
[Tika Wiki] Update of "ImageCaption" by ChrisMattmann
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Tika Wiki" for change notification.
The "ImageCaption" page has been changed by ChrisMattmann:
https://wiki.apache.org/tika/ImageCaption?action=diff&rev1=7&rev2=8
Comment:
- update docs to USCDataScience
===== a. Using docker (Recommended) =====
{{{#!highlight bash
+ git clone https://github.com/USCDataScience/tika-dockers.git && cd tika-dockers
- cd tika-parsers/src/main/resources/org/apache/tika/parser/captioning/tf/
- # alternatively, if you do not have tika's source code, you may simply wget the 'Im2txtRestDockerfile' from github link
- docker build -f Im2txtRestDockerfile -t im2txt-rest-tika .
+ docker build -f Im2txtRestDockerfile -t uscdatascience/im2txt-rest-tika .
- docker run -p 8764:8764 -it im2txt-rest-tika
+ docker run -p 8764:8764 -it uscdatascience/im2txt-rest-tika
}}}
- Once it is done, test the setup by visiting [[http://localhost:8764/inception/v3/captions?beam_size=3&max_caption_length=15&url=https://upload.wikimedia.org/wikipedia/commons/thumb/1/1d/Marcus_Thames_Tigers_2007.jpg/1200px-Marcus_Thames_Tigers_2007.jpg]] in your web browser.
+ Once it is done, test the setup by visiting [[http://localhost:8764/inception/v3/caption/image?url=https://upload.wikimedia.org/wikipedia/commons/thumb/1/1d/Marcus_Thames_Tigers_2007.jpg/1200px-Marcus_Thames_Tigers_2007.jpg]] in your web browser.
'''Sample output from API:'''
{{{#!json
{
+ {
- "captions":[
+ "captions": [{
+ "confidence": 0.010706611316269087,
- {
- "confidence":0.010706593208896654,
- "sentence":"a baseball player swinging a bat at a ball"
+ "sentence": "a baseball player swinging a bat at a ball"
- },
- {
- "confidence":0.004686318988055993,
+ },
+ {
+ "confidence": 0.004686326913725872,
- "sentence":"a baseball player swinging a bat at a ball ."
+ "sentence": "a baseball player swinging a bat at a ball ."
- },
- {
- "confidence":0.004108484241848782,
+ },
+ {
+ "confidence": 0.0041084865981657155,
- "sentence":"a baseball player swinging a bat on a field"
+ "sentence": "a baseball player swinging a bat on a field"
- }
- ],
+ }
+ ],
- "beam_size":3,
+ "beam_size": 3,
- "max_caption_length":15,
+ "max_caption_length": 20,
- "time":{
+ "time": {
- "read":1060,
- "captioning":570,
- "units":"ms"
- }
+ "read": 407,
+ "captioning": 1632,
+ "units": "ms"
+ }
}
}}}
@@ -66, +65 @@
4. Add an appname,Host IP 127.0.0.1 and set both ports to 8764.
===== b. Without Using docker =====
- If you chose to setup REST server without a docker container, you are free to manually install all the required tools specified in the [[ https://github.com/apache/tika/blob/master/tika-parsers/src/main/resources/org/apache/tika/parser/captioning/tf/Im2txtRestDockerfile | docker file]].
+ If you chose to setup REST server without a docker container, you are free to manually install all the required tools specified in the [[ https://github.com/USCDataScience/tika-dockers/blob/master/Im2txtRestDockerfile | docker file]].
Note: docker file has setup instructions for Ubuntu, you will have to transform those commands for your environment.