Comments (14)
Let me understand, you are trying to use the Caffe model from gillevi with dd, is that correct ?
I should be able to help, but more information is needed: all prototxt files typically and service + train API calls so that I can reproduce.
from deepdetect.
Yes, I am trying to use pretrained caffe model. It can be downloaded from here http://www.openu.ac.il/home/hassner/projects/cnn_agegender/cnn_age_gender_models_and_data.0.0.2.zip
To use the model I created "models/age" folder and put there deploy.prototxt (renamed deploy_age) and age.caffemodel files from the archive. Then I had created service using following code:
model = {'repository': '/home/ubuntu/models/age''}
parameters_input = {'connector':'image',
'width': 256,
'height': 256}
parameters_mllib = {'nclasses': 8}
parameters_output = {}
dd.put_service("age",
model,
"age classification",
'caffe',
parameters_input,
parameters_mllib,
parameters_output)
and the query is
curl -X POST "http://localhost:8080/predict" -d "{\"service\":\"age\",\"parameters\":{\"input\":{\"width\":256,\"height\":256},\"output\":{\"best\":3}},\"data\":[\"http://i.ytimg.com/vi/0vxOhd4qlnA/maxresdefault.jpg\"]}"
I think the problem is in deploy.prototxt and it should be converted somehow
from deepdetect.
Yes you need a memorydata layer at the top, this is so dd can pass data to the net. Look at the deploy file from templates/caffe/googlenet as an example. I will try to reproduce as well on my spare time, but please let me know how it goes.
from deepdetect.
Added following text to deploy.prototxt:
layers {
name: "caffenet"
type: MEMORY_DATA
top: "data"
top: "label"
memory_data_param {
batch_size: 32
channels: 3
height: 256
width: 256
}
}
And everything worked :) Should it be in the documentation?
from deepdetect.
Ah got it to work in parallel to you. The key is to convert the Caffe model from the old format to the new one, and then update the deploy.prototxt file as well.
I've put a model tarball for the 8 classes age model here: http://www.deepdetect.com/models/age_model.tar.bz2
It is ready to use, though I can't report on the accuracy.
It could be added to the 'model' page http://www.deepdetect.com/applications/model/
from deepdetect.
Have you run into a trouble mean.binaryproto has incorrect dimensions?
from deepdetect.
I believe dimension is 227x227.
from deepdetect.
Btw, the predict call does not yet read the mean.binaryproto file
. I will commit this shortly. From my short tests, it does affect the results significantly on this dataset.
from deepdetect.
Do you know what the age classes correspond to by any chance ? (0 to what range, etc..). Thanks.
OK. got it, put a file named corresp.txt
in your model repository with the following in it:
0 0_2
1 4_6
2 8_13
3 15_20
4 25_32
5 38_43
6 48_53
7 60+
This is deducted from http://www.openu.ac.il/home/hassner/projects/cnn_agegender/CNN_AgeGenderEstimation.pdf and I may be wrong.
from deepdetect.
Yes, I just wanted to send them to you. I copied classes from notebook that comes with modela and they are the same as in your list.
from deepdetect.
OK good! I was just surprised that the example they give in their tarball, example_image.jpg
seems to be reported as 60+
(0.53) and 0_2
(0.35). My own picture however is unfortunately not reported as younger...
from deepdetect.
Have you tried it in notebook from archive? Works fine there (even without mean substraction).
from deepdetect.
Somehow it works better for me without the mean substraction. I've investigated and failed to understand why. It's possible the mean.binaryproto
is not in the exact same format as the ones produced by the Caffe compute_mean
. The Caffe classification.cpp
example uses a planar 32-bit float BGR or grayscale format.
Closing this since it appears to be working fine with dd anyways, can be reopened if the mean file issue is a problem in practice.
from deepdetect.
Age model added to http://www.deepdetect.com/applications/model/
from deepdetect.
Related Issues (20)
- Inconsistent predictons using refinedet model HOT 12
- Memory leak on constant /predict requests HOT 8
- Refinedet Tensorrt prediction fails HOT 7
- Memory leak on compressed predict requests with oatpp HOT 7
- Different prediction with tensorrt on refinedet model for the version v0.18.0 HOT 3
- getting error while training, .solverstate HOT 23
- Chain predictions swapped between images HOT 2
- Simsearch query segfault when using IVF indexes, but not default/flat index HOT 6
- On object detect training call, missing either test or train list causes a segfault
- dd_client not find in this path anyone help HOT 2
- How do I do a face recognition using this? HOT 2
- DeepDetect full rewrite in Pure Java
- 'OCR' object has no attribute 'histogram_equalization' HOT 13
- "best: -1" in predict behaves differently in torch models HOT 2
- Torch v1.12 requires libcupti* but nvidia/cuda:11.6.0-cudnn8-runtime-ubuntu20.04 doesn't include it
- Race condition / pthread error when predicting
- I have error build xgboost HOT 1
- Using `true` or `false` instead of `1` or `0` for query params for status or labels returns a internal server error HOT 1
- Question about hosting the docker image HOT 4
- Graphics problem with tsne algorithm HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepdetect.