specifying bounding boxes when adding faces to large_person_group_person in cognitive Face API - microsoft-cognitive

What I'm trying to do is to use only face recognition without detection because I already have ground truth bounding box information. So I want to add faces to my large_person_group_person with my own bounding box information.
Is there a way to specify bounding box information when using face add function? or other functions that supports this?
The link below is the reference of face add function.
https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/599adf2a3a7b9412a4d53f42
the argument 'target_face' in face add function is used for selecting the face when the face is detected by the cognitive detector. The problem is that there are a lot of faces failed to be detected. what I want to do is to specify bounding box information.

Yes, you can use face bounding box information to add a face to your person in a large group. You can follow the steps below:
This is my image about to upload, I have marked the face bounding box information out :
Based on the face add API, you the "tragetFace" value should be: left,top,width,height. In this case values 315,178,53,53 .So just call the API as below :
https://faceteststan.cognitiveservices.azure.com/face/v1.0/largepersongroups/testlargegroup/persons/e28981bd-1361-411a-b28a-eb79bc06ea51/persistedfaces?targetFace=315,178,53,53&detectionModel=detection_02
Result :
As you can see a face has been added successfully . Juts modify the API params based on your own and your own requirement will be ok here.
Btw, pls note that if the provided "targetFace" rectangle is not returned from Face - Detect, there’s no guarantee to detect and add the face successfully.
Hope it helps .

Related

How to display duplicate maker in cluster here map

I am using here map and I use clustering. But I have problem for displaying maker whose cordinates are same /dublicate . When I zoom in clustering , unfortunately the makers are not visible but cluster is still visible. How to display these makers when cluster is zoomed ?
My clustering options is as following
var clusteredDataProvider = new H.clustering.Provider(dataPoints, {
clusteringOptions : {
eps : 16,
minWeight : 2
},
theme : new PusulaClusterTheme()
});
We had the same issue. If you absolutely need the markers to show the exact very same spot up to the inch so to speak, then I don't know what you could do. But we wanted to show markers for each house on a street and sometimes we had multiple families in a house so we could not get the multiple ones to properly show.
We opened a ticket with HERE and this was their reply:
"...when you are placing multiple markers at the same geo-point, it is
just that they are stacked one on top of the other. Since they are all
at the same coordinate only the top most one will be displayed. So
to enable multiple marker to be shown at the same coordinate, you will
need to have some logic to avoid overlapping of markers. There is no
method straight off the shelf in JS API that can do this for you, but maybe
you can use the method map.getObjectsat(X,Y) to check if there are
already any markers at the point. If there is an existing one, then use
some logic to slightly change the coordinate value of the new marker
to be added at the point.
We ended up copying a solution we found here on Stackoverflow see this link that was written for Google Maps, but is just as relevant here with HERE. It uses a function to randomly change the last digit or 2 of the coordinates if they are multiple, and that way all your multiple coordinates will be a little bit unique and spaced out.

Compare a side face with front using Face - API (MS Cognitive Services)

I am working on identifying a face against set of faces in database using MS Cognitive Services - Face API.
If the input face is a side face then it throws,
The length of faceids is not in a valid range.
error.
Is it possible to compare a side face with front one using Face - API?
Thanks.
Note: There is a question on EmguCV(Right side Face detection with EmguCv) for the same but I am using MS Cognitive Services Face API.
Saravanan,
You may have already figured this out, but I hit a similar issue with calling the Face Group API:
GroupResult x = await faceServiceClient.GroupAsync(values);
When "values" in this example only contained one FaceID I got this error. In my case it was a mistake on my part, as it is impossible to group only one face. The error message was a bit cryptic, though, and it took me a while to figure it out. This may help someone else in the future.

Here map drawing a route from A to B and displaying it even if the start point is in a building

As you can see the path below isn't totally complete.
I would like the path to be drawn from the start point (and not from the closest point in street).
Does anyone know if there is a way with heremap to draw this part ? Or is this just simple not possible ?
I've looked here without success: https://developer.here.com
I believe what you are looking for is to use the navigation position of the POI instead of the centroid location of the POI. By default the position returned of a place is the "center" of the building location, not the entrance location.
The solution:
Place the marker using Location#getAccessPoints() API
For indoor related usage, please also integrate with the 3d Venue APIs to add indoor routing to the app.

Google Earth Plugin not exact coordinates

I've got quite strange google earth plugin behaviour. I get the camera position from the plugin to create some KML with coordinates, then I store it in database. When I reload the page, then it reads the kml, inserts it inside some other string - as a result I've got a string with whole kml document inside my javascript code. Then I load it into the plugin. Usually everything works, however after loading I see two things:
The coordinates returned by the API are not the same I have in the kml I'm loading
The camera position is sometimes moved a little bit, which causes errors like: I've got a camera inside a building, and after a couple of page refreshing, the camera suddenly is outside the building.
Do you have any hints how this could be fixed?
Example:
I've created a document, and inserted this camera tag inside:
<Camera>
<gx:ViewerOptions><gx:option name='streetview'></gx:option></gx:ViewerOptions>
<longitude>2.1201209999999993</longitude>
<latitude>48.80452499999986</latitude>
<altitude>2.4999999991174264</altitude>
<heading>22.795249807940547</heading>
<tilt>82.25987544961218</tilt>
<altitudeMode>relativeToGround</altitudeMode>
</Camera>
Then I loaded it into the plugin, and asked to fly there. When it stopeed flying, I got the coordinates using copyAsCamera() and the latitude was changed to 48.8044078508718.
The difference is not huge, just 0.000117149 but as a result it is showing a totally different place (a different room in the palace.
I'm trying to get exactly the same place, as written in the coordinates.
I have rewritten the answer to cover the various points you have made and the example you have provided.
street view
The KML data is setting <gx:ViewerOptions> to enter street view mode based on the camera. The key words being based on - a street view is an approximation. Things like the camera tilt and heading are no longer applicable as they are replaced by a SteeetView POV object. Further to that you can't guarantee that a camera at any given latitude and longitude will actually enter street view at the same given latitude and longitude.
relativeToGround and terrain data
Using altitude mode relativeToGround can cause the issue you are seeing. This is because the terrain data hasn't always finished streaming when the relatively positioned element (in your case a camera) is added.
To be clear you should use <altitudeMode>absolute</altitudeMode> and ge.ALTITUDE_ABSOLUTE.
The example you provided uses both <altitudeMode>relativeToGround</altitudeMode> and ge.ALTITUDE_RELATIVE_TO_GROUND.
You could also try disabling the terrain data by turning off the terrain layer, i.e.
ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN, false);
multiple viewchangeend events
The viewchangeend event may fire in the middle of a viewchange, especially if the plugin pauses for a brief period during the change. Your markup is triggering street view mode which causes this to happen.
You can resolve this by using setTimeout to throttle the viewchangeend event like so.
var timer = null;
google.earth.addEventListener(ge.getView(), 'viewchangeend', function(){
if(timer){
clearTimeout(timer);
}
timer = setTimeout(eventHandler, 100);
}
);
see: https://developers.google.com/earth/documentation/events#event_listeners
Tilt discrepancy
The plugin automatically "swoops" at ground level so that it moves from looking straight down (0 degrees tilt) to straight along the horizon (90 degrees tilt). This is what is causing the discrepancy in the tilt value in the view. You are viewing objects at ground level and so the view is being automatically set - this can't be disabled.
Storing and outputting KML data
Take a look through this document, it gives some really good information of storing coordinate data and covers points like the one I mentioned - A Database Driven Earth App.
.

nearest street view image

How to get the nearest GoogleStreetView image and its exact position with an inaccurate position? thanks to an other api?
Google maps do it, example :https://maps.google.fr/maps?q=45.755622,4.869343&hl=fr&num=1&t=m&z=16
but the API is less tolerant :
http://maps.googleapis.com/maps/api/streetview?size=400x400&location=45.755622,4.869343&fov=90&heading=235&pitch=10&sensor=false
According to API documentation, we should use this kind of url :
.../maps/api/streetview?size=400x400&location=40.720032,%20-73.988354&sensor=false&key=API_console_key
no possibility to check if a photo is available (parssing the photo color?)
(reversing: http://cbk0.googleapis.com/cbk?output=xml&ll=40.720032,%20-73.988354&cb_client=apiv3 give the exact position of an image, I used it on my android project but this webservice seems not maintained for a public use ?? :/)
You may use StreetViewService.getPanoramaByLocation()
There is a radius-parameter, when he is less then 50 you will receive data for the nearest panorama(within 50 meters).
When no panorama is available within 50 meters you may increase the radius until you get a result.

Resources