How to check similar faces in cognitive face api using persistedFaceIds - microsoft-cognitive

I am using face api to compare confidence level of 2 images.
i was using face list where i was adding some images and then comparing new image faceid with this list and getting its confidence level.
But as mentioned in https://eastus2.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237 faceid is only for 24 hours and expire after that. But persistedFaceIds never get exprire. So can you please suggest how can i use this persistedFaceIds to compare newly added faceid to get its confidence level. We can only create 64 facelists in cognitive (per subscription) and per list contains 1000 records. This is also one limit of this api.
Following is my requirement:
I storing person's images on server. But every image should be unique. Lets suppose if i got an image which is already store on server so i need to ignore that image.
please suggest how can i achieve this? Thanks

Instead of using FaceList, I would suggest you to use PersonGroup[1][2] instead.
PersonGroup support 10,000 persons per person group, it should fits more most common scenario. And you can use the identify [3] api to check whether the image belongs to one specific person.
[1] https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244
[2]
https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523c
[3]
https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239

Related

Using LinkedIn API to retrieve advertising reports

I'm working on a simple app to programmatically retrieve ads performance within Linkedin. I have general API experience but this is the first time i get my feet wet with the Linkedin API.
One example from Linkedin API documentation suggest something that would get me started:
GET https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&dateRange.start.month=1&dateRange.start.day=1&dateRange.start.year=2016&timeGranularity=MONTHLY&pivot=CREATIVE&campaigns=urn:li:sponsoredCampaign:112466001
I am encountering two problems:
First this example implies that you already know the campaign ID. However I am unable to find a way to retrieve a list of campaign ID's for a given account.
Second, if I manually pull a campaign ID, I receive an error: "{"serviceErrorCode":2,"message":"Too many fields requested. Maximum possible fields to request: 20","status":400}". Pretty clear error.
A little research tells me that by adding the parameter "&fields=" I will be able to limit my query to less than 20 field (I really need only a dozen anyway) but I can't find and documentation regarding the names of the fields available.
Any help or pointer will be appreciated.
please refer the link below scroll down where you ill see the field names mentioned as metrics , these are the fields.
https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ads-reporting?tabs=http#analytics-finder

How to fetch exactly same results of Google Grocery stores near to me

I am wondering to find a way to fetch exactly similar results of google grocery stores near to me
I have used the below API to get nearby grocery stores
https://maps.googleapis.com/maps/api/place/nearbysearch/json?sensor=true&radius=5000&key=AIzaSyC9rFJ90pP1oHpLrqpR2B0HtUboLaHmnDw&location=45.4940475,-73.5606149&type=supermarket&rankby=prominence
but it's not showing the all popular stores with matching to google grocery stores near to me best match (attached images).
What is the way to achieve functionality by applying filters From API? please, advice appreciated if its possible immediate replay.
Thanks
The API only will gather data by distance, prominence, and type. It is up to you how you want the data be sorted/filtered and which to display to your users.
Get your data: rankby
If rankby=distance (described under Optional parameters below) is
specified, then one or more of keyword, name, or type is required.
If you want to rank by distance, you will need to remove radius parameter form your url.
radius — Defines the distance (in meters) within which to return place
results. The maximum allowed radius is 50 000 meters. Note that radius
must not be included if rankby=distance (described under Optional
parameters below) is specified.
This will get you started. Places Library

Using Face API To Identify Users

I am trying to create the ability to take a picture of a person and locate their user account based on a picture of them. I have 1MM users and each will have a photo which is only of them and will be associate to their user account via the creation of a PersonFace which is added to a Person which is in a PersonGroup. So with 10K persons per Person Group I need about 100 person Groups for me 1MM users.
So once all this is setup I am not clear on how I detect a face given a supplied photo. That is, I know I pass the photo via 'Detect' call however what is returned is an array of Face[] each which include a FaceId and to get from FaceId to a person I must call 'Identify', however that call requires I pass a Person Group Id, but I have 100 of them.
So given this the only solution I can come up with is to call Identify via loop through all 100 group Ids?
Currently, yes, that is the only way to do it. Which obviously makes scanning 1 million persons a less than ideal scenario given the 10 transactions per second limit.
There are a couple upcoming features which will improve this scenario, but right now I don't have an ETA for them:
Significantly higher limits of Persons per PersonGroup
Additional tiers of the Face API which allow significantly higher transaction per second rate limits.

Google store locator library limit markers in right hand panel

I'd like to limit the number of markers that appear on the map in the right hand panel to something like 10 at any zoom level.
How can this be achieved?
The library can and examples can be found here:
http://storelocator.googlecode.com/git/index.html
I am following the code example given here:
http://storelocator.googlecode.com/git/examples/panel.html
There is a code reference here:
http://storelocator.googlecode.com/git/reference.html
But it's still not clear to me exactly how I can customise the example I am following so that it only shows a maximum of 10 markers at any one time.
EDIT : Why I want to do this
I sell a product wholesale to many salons. With this map I am trying to show customers which salons they can go to buy the products I supply.
However in the example given by google, the full list of salons appear as markers on the map. This is not good because it is then possible for competitors to glean an entire list of salons that they can market competing products to.
The solution I'd like would be to only show a maximum of 10 markers at a time according whichever is closest to the inputted address.
For me the example( http://storelocator.googlecode.com/git/examples/panel.html ) always show only up to 10 entries in the panel. There is a hardcoded limit of 10 , so it's not possible to achieve it without modifying the store-locator.min.js
But when you wan't to display less than the 10 entries, it would be possible via CSS:
/* limit the displayed entries to 5 */
.store-list li:nth-child(n+6){display:none}
When you want to apply a higher limit(or when it should be compatible with IE<9) edit this part in store-locator.min.js(line 28)
m=e.min(10,c[E]);
(set the 10 to the desired value)
To limit the number of results at all edit this line in MedicareDataSource.prototype.parse_
for (var i = 1, row; row = rows[i]; i++)
and set it to
for (var i = 1, row; row = rows[i],i<XXX; i++)
(where XXX is the limit +1, so e.g. setting XXX to 11 will apply a limit of 10)
There's a few general approaches, and the better solution depends a bit on your total number of stores you have, and how hard you want to make it for someone to scrape.
You could continue to use the static data feed like in this example (which means sending all stores to the browser on load), and then add some logic to only display the closest 10 (such as setting the map to null for all markers that aren't also shown in the panel), but this is not a good solution if:
there are lots of stores (more than a thousand or so) since it will be unnecessarily slow to load them all when only displaying a few.
you don't want someone to look at your code and just grab the full CSV you're sending down the wire with all your data.
Given your scraping concern, a better method is probably to implement the store locator using a dynamic datasource that only returns the closest N records for a given lat/lng so you don't expose the entire thing at once. Using Google services you could use Maps Engine which has an API, and the store locator includes a Google Maps Engine example you could start with. Your security concern here is if these queries are publicly available for anyone to hit directly, the table is also public and then someone could query for the full table. So you'd want to put a proxy inbetween to avoid that type of query hack (although of course someone could just feed you lots of locations to eventually get all your stores if they really wanted).
Other options (again just looking at Google's stack although there are lots of alternatives for this kind of thing, like CartoDB and many more) include AppEngine's Search API which also returns the N closest items (but would require some server side coding which Maps Engine would not), or even put the data into Google spreadsheets and implement a basic Script -> Web Service, where your script takes the lat/lng and do some basic math to find the closest.
Again if you don't love the server side aspect then Maps Engine is probably your best bet for a quick start especially given there's a working sample in the storelocator code.

Get more than 7 dimensions in google analytics

I am fetching my data from google analytics core api. I came to know that we can fetch only 7 dimensions using api, But here I need to fetch more than 7 dimensions with correct metrics. Is there anyway (other than using paid google analytics) to fetch more than 7 dmensions with correct metrics from google analytics.
If not, then is there any mathematical formula through which we can find intersection of dimensions fetched using 2 different dimensions having one dimension in common.
Thanks
The only way I have found around the 7 dimension limit is to be creative with filters. It will mean that you are sending more queries to the server, but if you aren't worried about your quota limit then its doable.
Example: ga:visitorType only has two values. New Visitor, Returning Visitor
So you could run a query with your 7 dimensions. Then add A filter ga:visitorType=New Visitor then run the same 7 dimensions with a filter added of ga:visitorType=Returning Visitor
Bingo you just got an 8th dimension.
Again you need to be a little careful because you are going to increase the number of queries you run by each value of dimension you are doing creative filtering on. I wouldn't recommend doing it with say ga:landingPagePath because the number of landing pages you have is to big. You will end up running too many queries. But there are a few you can do this with. ga:isMobile, ga:deviceCategory, ga:date. Just remember the more creative filters you add the more queries you end up running. I had one where I ended up expanding it to 80 requests just to get the data back I needed. Scary but it worked.
If you have specific dimensions that can be used to identify a session at a specific time (e.g. a session ID and browser timestamp), you can execute multiple queries then patch them together.
I built a python program that will do exactly this: https://github.com/aiqui/ga-download
This program can bring together multiple groups of dimensions, so that any number of dimensions can be downloaded and combined into a single CSV file.

Resources