docker pull jainal09/densecap_gpu:latest
Fork the repo - https://github.com/qassemoquab/stnbhwd
Head to https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ and find your gpu sm version.
Open the CMakeLists.txt file in edit mode in the forked repo of stnbhwd.
Edit line no. 55
LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_20")
to your sm version.
For Example for my nvidia tesla k80 gpu sm version is sm_37.
LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_37")
Commit and push the code.
Open the file stnbhwd-scm-1.rockspec in edit mode in forked repo of stnbhwd.
Change the source - url to the url of the forked repository.
For example:
source = {
url = "git://github.com/qassemoquab/stnbhwd.git",
}
to
source = {
url = "git://github.com/jainal09/stnbhwd.git",
}
In Github click on raw button in file stnbhwd-scm-1.rockspec and copy the raw url
Run the image and access the shell by:
docker run --gpus all -it -p 7000:7000 jainal09/densecap_gpu:latest
luarocks install [********the raw url of stnbhwd-scm-1.rockspec of your forked repo ********]
wget https://raw.githubusercontent.com/jcjohnson/densecap/master/imgs/elephant.jpg
th run_model.lua -input_image elephant.jpg
densecap/vis/data/results.jsonAlso you can run:
cd vis
python -m SimpleHTTPServer 7000
And head to localhost:7000 in browser to view the results.
I have also added a rest api server for inference on the pre trained model!
uvicorn main:app --reload --host 0.0.0.0 --port 7000
Head to localhost:7000/docs to upload an image and fetch its captions. (Only works on single image files)
Curl Command
curl -X POST "http://localhost:7000/uploadfile/" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "[email protected];type=image/jpeg"
Content type
Image
Digest
Size
6.7 GB
Last updated
about 6 years ago
docker pull jainal09/densecap_gpu