CSAILVision / LabelMeAnnotationTool

Source code for the LabelMe annotation tool.
MIT License
1.38k stars 436 forks source link

added tested Dockerfile #29

Closed timkock closed 7 years ago

timkock commented 7 years ago

Thought this was missing a Dockerfile and #17 seemed to have some interest so decided to create one. Currently using this for some quick annotations.

from docker hub

mkdir -p ~/Desktop/annotate/Images
mkdir -p ~/Desktop/annotate/Annotations
docker run -d --name annotate -p 1337:80 -v ~/Desktop/annotate/Images:/var/www/html/Images -v ~/Desktop/annotate/Annotations:/var/www/html/Annotations jungleai/annotate:latest

from dockerfile You can also build your own image from this Dockerfile and do the following

docker build -t yourorganisation/yourimagename:latest .
mkdir -p ~/Desktop/annotate/Images
mkdir -p ~/Desktop/annotate/Annotations
docker run -d --name annotate -p 1337:80 -v ~/Desktop/annotate/Images:/var/www/html/Images -v ~/Desktop/annotate/Annotations:/var/www/html/Annotations yourorganisation/yourimagename:latest

In either case use local folders as you like but running works with attaching host folders the container. In this way if you were to follow the example above and place a folder called logos in ~/Desktop/annotate/Images and you dump .jpg files in that folder. Then when running the container navigate to http://localhost:1337/tool.html?mode=f&folder=logos to start annotating. You will find the xml's in ~/Desktop/annotate/Annotations/logos.

fagg commented 7 years ago

(How ironic that I go looking to run LabelMe inside Docker and find this committed only a few minutes before)

The current Docker image from Docker hub does not seem to work. This is all I get:

screen shot 2016-10-11 at 12 20 11

I tried a couple of other images and Chrome occasionally pops up with an error from "fetch_images.cgi". Though it doesn't actually say what the error is.

timkock commented 7 years ago

hi @fagg check the folder query string, does that folder exist (if you have mapped volumes as I wrote then it won't work) if not then yes most likely

fagg commented 7 years ago

So this is what I tried.

I recreated the Docker as per:

screen shot 2016-10-11 at 12 53 31 1

The folder exists:

screen shot 2016-10-11 at 12 54 24

If I bring up the browser, it just hangs:

screen shot 2016-10-11 at 12 56 05

timkock commented 7 years ago

Hi @fagg, I removed all local images and ran the pull from dockerhub fresh on a different computer with a different folder and images, the screenshot below shows all steps & result in one. screenshot 2016-10-11 19 09 11

fagg commented 7 years ago

Thanks for your help, but still not working. I followed your steps exactly and still the same thing.

On 11 October 2016 at 13:10, Tim Kock notifications@github.com wrote:

Hi @fagg https://github.com/fagg, I removed all local images and ran the pull from dockerhub fresh on a different computer with a different folder and images, the screenshot below shows all steps & result in one. [image: screenshot 2016-10-11 19 09 11] https://cloud.githubusercontent.com/assets/5517498/19280465/4fb01140-8fe6-11e6-8e11-c0db1d79588d.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CSAILVision/LabelMeAnnotationTool/pull/29#issuecomment-252981118, or mute the thread https://github.com/notifications/unsubscribe-auth/ABqWhCnQ9_rgHB5YP5HMdMC23FQaXE0cks5qy8L4gaJpZM4KTw3g .

timkock commented 7 years ago

Wow thats totally weird, I wanna help you out man but don't know what I can do from here... I checked this on two other macs and it worked fine. Have you checked the following perhaps?

The last thing I can think of for you to try is docker run -d --name plaintest -p 1337:80 jungleai/annotate:latest and to go directly to http://localhost:1337/tool.html?collection=LabelMe&mode=i&folder=example_folder&image=img1.jpg. This works straight out of the box. Without any alterations on your local file system.

fagg commented 7 years ago

Hmm, okay, that works.

I'm running Ubuntu 16.04. Docker version 1.12.1, build 23cf638

My user is in the docker group, so this seems fine. The folder that I am linking to is inside my home directory, so I should be able to read/write. screen shot 2016-10-11 at 14 05 35

timkock commented 7 years ago

Right then it's something weird with the mounted volumes. I guess just experiment on that, check the commands thoroughly. I am not sure if mounting host folders is different in Ubuntu 16.04 with Docker, maybe stackoverflow that... ? Just searching quickly found this, maybe it's related?

https://github.com/docker/docker/issues/22828

fagg commented 7 years ago

I gave up and just built my own Docker image with all of the data I need inside of it. Thanks anyway.

timkock commented 7 years ago

Haha ok! Ill check tomorrow on a server we have that is running 16.04 see if I can replicate it failing. Hope the Dockerfile at least gave some inspiration

fagg commented 7 years ago

It was very useful, thanks.

ortizeg commented 7 years ago

@timkock I thought I might add that I'm on Mac OS X El Capitan. If I download your Dockerfile and build it locally, I get the error @fagg gets. However, if I just grab your image from docker hub everything works perfectly fine. Did you do any additional edits to your Dockerfile locally before uploading the image?

ortizeg commented 7 years ago

I think I made a mistake configuring the apache server. So, a not for others, make sure you get everything that's in ubuntu.conf.

ortizeg commented 7 years ago

Also, I recommend copying over the directory instead of doing a git clone. This would ensure somebody who is actively developing a local copy of the repo can test it out quickly. Something like:

RUN rm -rf /var/www/html && \
    mkdir /var/www/html
COPY . /var/www/html
RUN chown -R ${APACHE_RUN_USER}:${APACHE_RUN_GROUP} /var/www

to replace the portion under deploy repo.

timkock commented 7 years ago

hi @ortizeg thanks for all your input. We didn't make any adjustments to the docker file in the hub beyond whats in this repo. We are currently building an annotation tool that will learn whilst annotating to start suggesting segmentations in a little more intuitive way than this system. That is why this tool is not getting a lot of attention from us at the moment. Did you manage to run it in a docker file in the end? Still want to help out people wanting to use this tool with Docker

ortizeg commented 7 years ago

I did get it working. Thanks!

That sounds great! Do you guys have an ETA? And I assume this'll be a pay for use application?

ahaque commented 7 years ago

This works for me.

danvass commented 7 years ago

@timkock I used the first example you gave to run it and it works but when finishing annotating it always gets a server error when trying to do submit.cgi.

EDIT: Turns out needed to set correct permissions on the Images and Annotations folder.

ghost commented 7 years ago

How can we run this docker on aws ec2 instance?