Hi,

Short answer: you cant.

Longer answer: If you use as training samples the whole images (with faces
somewhere in there), then your model is learning to discriminate between
your 2 categories, from the whole images, with **no** information about
where the faces are actually located. As such, it is not learning to detect
faces. It is learning to discriminate between images that contain faces
(somewhere) and images that do not. What I mean to say is that it may as
well learn to detect "non-faces" elements (background stuff) than to detect
faces. Therefore, it may predict than an image is a "face" because it
contains no "non-faces" elements. It is also very like to exploit artifacts
to "learn" to discriminate between your categories (e.g., say that all
images with faces contain a blue sky, then a new image may be labeled to be
a face because it contains a blue sky, not because it contains a face).

If you want to build a proper face detector, than you should train your
model directly on the regions of interest containing the faces. Once your
model is trained, then to detect faces in new image, you can scan the whole
image with a sliding window of the size of training rectangles and apply
your detector on each one of these.

Hope this helps,

Gilles


On 19 March 2013 05:19, Fimi <afrim...@yahoo.com> wrote:

>  Hello,
> **
> I've got non linear multiclass classification for support vector machines
> to work and it does predict the correct face and non face images. It has
> been a very steep learning curve for me because this is the first time I do
> this type of work.
> **
> I would like to see if you can guide me on a good direction on how I would
> go about finding the area of the face is. My goal is to draw a square
> around the area of a face so that I can visually show where it has found it.
> **
> I have spent many hours (and days in this project) on the website of
> scikit-learn page trying to find out things. When I do a prediction, the
> only thing i get back is a list of predicted labels. I also looked into the
> values and functions that are present in the object when performing the
> SVC.fit(X,y) and SCV.predict(..) but could not figure out how to do this.
> **
> I would appreciate any help. Thank you.
> **
> Here's some code snippet that i currently have:
> parameters = {'kernel':('linear','rbf'), 'C':[1,2,3,4,5, 10]}
> svr = SVC(verbose=True)
> clf = GridSearchCV(svr, parameters)
> clf.fit(data, y_train)
> print "Best Estimator",clf.best_estimator_
>
> y_predict = clf.predict(test_data)
> #plot one of the images that was predicted
> #draw squares to indicate location of faces
> **
> **
> **
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to