Cross checking of labels of two different photos - json

I'm working on a project where my application needs to point out if 2 photos might be taken at the same place.
Google vision will analyze each image to a JSON file, containing the labels with the highest scores.
for example:
{
"labelAnnotations": [
{
"mid": "/m/0j_s4",
"description": "metropolitan area",
"score": 0.91176826
},
{
"mid": "/m/039jbq",
"description": "urban area",
"score": 0.8989959
},
{
"mid": "/m/01n32",
"description": "city",
"score": 0.8808476
},
{
"mid": "/m/0vlys",
"description": "tower block",
"score": 0.8789163
}]}
Is there a know algorythm for cross checking the labels of two different photos, so it would give us the similarity between those photos.. using google vision?

Related

Retrieving "Description" or "Custom Attribute" fields using Autodesk Forge API

We are trying to retrieve the description or custom attribute field as shown in BIM360 Docs using Autodesk Forge API requests/commands.
We have tried the following requests to retrieve information about a specific file:
https://forge.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-items-item_id-GET/
https://forge.autodesk.com/en/docs/data/v2/reference/http/ListItems/
We get a lot of information/data about our files, but we cannot see the Description field neither a Custom Attribute in the responses that we are getting.
"data": {
"type": "versions",
"id": "urn:adsk.wipprod:fs.file:vf.WKuhlYuyR8uK2WT8HE1bCQ?version=20",
"attributes": {
"name": "TESTING",
"displayName": "TESTING",
"createTime": "2019-07-29T09:37:33.0000000Z",
"createUserId": "*****",
"createUserName": "TESTING",
"lastModifiedTime": "2019-08-05T08:27:10.0000000Z",
"lastModifiedUserId": "*****",
"lastModifiedUserName": "TESTING",
"versionNumber": 20,
"storageSize": 27020,
"fileType": "xlsx",
"extension": {
"type": "versions:autodesk.bim360:File",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.bim360:File-1.0"
},
"data": {
"processState": "PROCESSING_COMPLETE",
"extractionState": "UNSUPPORTED",
"splittingState": "NOT_SPLIT",
"revisionDisplayLabel": "20",
"sourceFileName": "TESTING"
}
}
},
...
}
Among all of these fields, we expected the fields "Description" or "Custom Attributes" to appear as well (As they are shown in BIM360 DOCS). ¿Is it possible to retrive these fields using API requests?
At the moment it is not possible to retrieve Custom Attribute information from BIM 360 Docs, But a new API is under development and in Private Beta testing at the moment to get this information back, Please check back with us in a near future since this will become available soon. Thank you for understanding.

How to sort a list of restaurant names by restaurant rating (possibly from Google Places or Yelp Fusion API)

I have a csv file with thousands of restaurant names and addresses that I need to sort by rating (data that is not in the csv). Is there a way to fill in the csv with this data? Possibly with Google Places API or Yelp Fusion API?
Both the Google Places API and Yelp Fusion API let you obtain a restaurant’s rating if you query with the business name and address. I’m going to explain how to do this but, first a caution about compliance. What you describe is clearly against the terms of service for both APIs. The only permitted use of their data is to display it on a publicly available website or app. Fetching and retaining it in a csv file is clearly improper. The APIs are intended for real-time query and immediate display of results for your users.
Google requires that the Places data be displayed in conjunction with a Google map or an approved "powered by Google" image. Additionally, no "pre-fetching, caching, or storage of content" is permitted. For details see https://developers.google.com/places/web-service/policies
Yelp requires attribution, basically requiring you to display the star rating and the Yelp logo with a link back to the business page on Yelp for the restaurant you have queried. See https://www.yelp.com/developers/display_requirements Furthermore, you can’t “cache, record, pre-fetch, or otherwise store any portion of the Yelp Content for a period longer than twenty-four (24) hours from receipt of the Yelp Content, or attempt or provide a means to execute any scraping or "bulk download" operations.” For full text and terms see https://www.yelp.com/developers/api_terms
With the legalese out of the way, here’s how to request a restaurant’s rating from Google Places:
https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=Applebees,234 W 42nd St,New York,NY&inputtype=textquery&fields=formatted_address,name,rating&key=YOUR_API_KEY
And, the JSON response:
{
"candidates": [
{
"formatted_address": "234 W 42nd St, New York, NY 10036, USA",
"name": "Applebee's Grill + Bar",
"rating": 3.6
}
],
"status": "OK"
}
Here is the same request for Yelp Fusion. There is no way to request just the rating. Results always contain everything in their database for the restaurant:
https://api.yelp.com/v3/businesses/search?term=applebees&location=234 W 42nd St,New York,NY&limit=1
JSON response:
{
"businesses": [
{
"id": "gytFjzBw-z5LZD-6JSMChg",
"alias": "applebees-grill-bar-new-york-3",
"name": "Applebee's Grill + Bar",
"image_url": "https://s3-media1.fl.yelpcdn.com/bphoto/CLizyj9S7pMvwGNm2dgdiQ/o.jpg",
"is_closed": false,
"url": "https://www.yelp.com/biz/applebees-grill-bar-new-york-3?adjust_creative=pnOv3Zj2REsNDMU4Z3-SLg&utm_campaign=yelp_api_v3&utm_medium=api_v3_business_search&utm_source=pnOv3Zj2REsNDMU4Z3-SLg",
"review_count": 444,
"categories": [
{
"alias": "tradamerican",
"title": "American (Traditional)"
},
{
"alias": "burgers",
"title": "Burgers"
},
{
"alias": "sportsbars",
"title": "Sports Bars"
}
],
"rating": 2,
"coordinates": {
"latitude": 40.756442,
"longitude": -73.988838
},
"transactions": [
"delivery",
"pickup"
],
"price": "$$",
"location": {
"address1": "234 W 42nd St",
"address2": "",
"address3": "",
"city": "New York",
"zip_code": "10036",
"country": "US",
"state": "NY",
"display_address": [
"234 W 42nd St",
"New York, NY 10036"
]
},
"phone": "+12123917414",
"display_phone": "(212) 391-7414",
"distance": 5.938732504864397
}
],
"total": 2900,
"region": {
"center": {
"longitude": -73.98880004882812,
"latitude": 40.75648701137637
}
}
}

Marking The Area objects in Sheets of Revit

I have been tried to get Area objects from Sheets (3D Submission) of Revit file through Forge API. Using this link GET /modelderivative/v2/designdata/{urn}/metadata/{guid of sheet}/properties the Area Information isn't there, even though i have added the area in sheets.
My goal is marking the Area in 2D / Sheets (3D Submission). How can i do that ?
The Area, i mean like this >> marking The Area in 2D
The area object looks like Revit Room or Revit Zoom. If your zoom or room is clickable on the Viewer, then you can obtain its properties via the API Get Properties. Here are a few steps I used to archive what you want, you can compare if there is something you missed.
Check the room/area elements are valid in your Revit sheet. A room/area should be enclosed by walls or Room Separation/Area Boundary.
Make sure the sheet which contains your room/area is included in the set of the Revit Publish Setting
Upload the well-configurated RVT to Forge for translation.
After translation was completed, load the sheet view (called A102 - Plans in this case) via Forge Viewer, and make sure that room/area elements in the view are clickable.
Retrieve the objectId of selected room/area via viewer.getSelection(). The objectId of the selected room/area in this view is4089` for example.
Call API GET :urn/metadata to get sheet's guid. Now it's abdacd31-f94c-e84f-9a58-4663e281d894 for instance.
{
"data": {
"type": "metadata",
"metadata": [
{
"name": "{3D}",
"role": "3d",
"guid": "6bfb4886-f2ee-9ccb-8db0-c5c170220c40"
},
{
"name": "A102 - Plans",
"role": "2d",
"guid": "abdacd31-f94c-e84f-9a58-4663e281d894"
}
]
}
}
Call API GET :urn/metadata/:guid to obtain instance tree of that view, and check if there is a room/area with the id we want. e.g. the room named as Kitchen & Dining 101 [857279] and id is 4089 in the API response.
{
"objectid": 4084,
"name": "Rooms",
"objects": [
{
"objectid": 4085,
"name": "Bath 203 [857200]"
},
{
"objectid": 4086,
"name": "Bath 205 [857203]"
},
{
"objectid": 4087,
"name": "Bedroom 202 [857206]"
},
{
"objectid": 4088,
"name": "Entry Hall 201 [857209]"
},
{
"objectid": 4089,
"name": "Kitchen & Dining 101 [857279]"
}
]
}
Call API GET :urn/metadata/:guid/properties in this way to retrieve properties of the room/area. For example, /modelderivative/v2/{YOUR_RVT_URN}/metadata/abdacd31-f94c-e84f-9a58-4663e281d894/properties?objectid=4089 and its response is shown as below, then you will see area which you want is showing in the response.
{
"data": {
"type": "properties",
"collection": [
{
"objectid": 4089,
"name": "Kitchen & Dining 101 [857279]",
"externalId": "e6ac360b-aaed-4c3b-a130-36b4c2ac9d13-000d1467",
"properties": {
"Constraints": {
"Base Offset": "0.000 mm",
"Level": "Level 1",
"Limit Offset": "6500.000 mm",
"Upper Limit": "Level 1"
},
"Dimensions": {
"Area": "26.971 m^2",
"Computation Height": "0.000 mm",
"Perimeter": "29060.000 mm",
"Unbounded Height": "6500.000 mm",
"Volume": "118.317 m^3"
},
"Identity Data": {
"Base Finish": "",
"Ceiling Finish": "",
"Comments": "",
"Department": "",
"Floor Finish": "",
"Image": "",
"Name": "Kitchen & Dining",
"Number": "101",
"Occupancy": "",
"Occupant": "",
"Wall Finish": ""
},
"Phasing": {
"Phase": "Working Drawings"
}
}
}
]
}
}
Hope it helps~

Deezer api search url album cover is missing

Since two days we got a problem with the Deezer Api on this url:
http://api.deezer.com/search/autocomplete?q=Jean
In the object returned, some fields are now missing in the album object and in the base object.
The fields which usually contain the images disappeared.
{
"id": 122440564,
"readable": true,
"title": "Aloha",
"title_short": "Aloha",
"title_version": "",
"link": "http://www.deezer.com/track/122440564",
"duration": 218,
"rank": 0,
"explicit_lyrics": false,
"preview": "http://cdn-preview-9.deezer.com/stream/9f7248e8744c135d4878ae851d8bb881-4.mp3",
"artist": {
"id": 5542423,
"name": "Møme",
"link": "http://www.deezer.com/artist/5542423",
"picture": "http://api.deezer.com/artist/5542423/image",
"picture_small": "http://cdn-images.deezer.com/images/artist/6054372bc5d6dc0a2d355d5a2d55242a/56x56-000000-80-0-0.jpg",
"picture_medium": "http://cdn-images.deezer.com/images/artist/6054372bc5d6dc0a2d355d5a2d55242a/250x250-000000-80-0-0.jpg",
"picture_big": "http://cdn-images.deezer.com/images/artist/6054372bc5d6dc0a2d355d5a2d55242a/500x500-000000-80-0-0.jpg",
"picture_xl": "http://cdn-images.deezer.com/images/artist/6054372bc5d6dc0a2d355d5a2d55242a/1000x1000-000000-80-0-0.jpg",
"tracklist": "http://api.deezer.com/artist/5542423/top?limit=50",
"type": "artist"
},
"album": {
"id": 12811488,
"title": "Aloha",
"tracklist": "http://api.deezer.com/album/12811488/tracks",
"type": "album"
},
"type": "track"
},
I checked in the Deezer Api documentation, and apparently the version doesn't change, and, based on the documentation, the album object normally contain the cover album:
http://developers.deezer.com/api/search/album
Did anyone got the same issue ? I tried to tweet them and I also sent an email to api#deezer.com.
It has been fixed, we had some side effects that are now resolved.

Mapquest API Route Matrix time and day options do nothing

I am writing a simple application in Java to get time and drive distance data from the MapQuest API using their Route Matrix. I can get regular data just fine, but it appears that the date and time parameters (explained here) do not change anything.
My two request bodies are:
{"locations": ["55455","55113"],"options": {"allToAll": true,
"dateType": 0,"date": "12/17/2016","timeType": 2,"localTime": "12:00"}}
and
{"locations": ["55455","55113"],"options": {"allToAll": true,
"dateType": 0,"date": "12/13/2016","timeType": 2,"localTime": "16:30"}}
I get the same response for both requests:
{
"allToAll": true,
"time": [
[
0,
573
],
[
562,
0
]
],
"distance": [
[
0,
7.485
],
[
6.764,
0
]
],
"locations": [
{
"latLng": {
"lng": -93.234543,
"lat": 44.975052
},
"adminArea4": "Hennepin County",
"adminArea5Type": "City",
"adminArea4Type": "County",
"adminArea5": "Minneapolis",
"street": "",
"adminArea1": "US",
"adminArea3": "MN",
"type": "s",
"displayLatLng": {
"lng": -93.234543,
"lat": 44.975052
},
"linkId": 286290952,
"postalCode": "55455",
"dragPoint": false,
"sideOfStreet": "N",
"adminArea1Type": "Country",
"geocodeQuality": "ZIP",
"geocodeQualityCode": "Z1XAA",
"adminArea3Type": "State"
},
{
"latLng": {
"lng": -93.15676,
"lat": 45.012234
},
"adminArea4": "Ramsey County",
"adminArea5Type": "City",
"adminArea4Type": "County",
"adminArea5": "St Paul",
"street": "",
"adminArea1": "US",
"adminArea3": "MN",
"type": "s",
"displayLatLng": {
"lng": -93.15676,
"lat": 45.012234
},
"linkId": 286290770,
"postalCode": "55113",
"dragPoint": false,
"sideOfStreet": "N",
"adminArea1Type": "Country",
"geocodeQuality": "ZIP",
"geocodeQualityCode": "Z1XAA",
"adminArea3Type": "State"
}
],
"manyToOne": false,
"info": {
"copyright": {
"text": "© 2016 MapQuest, Inc.",
"imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "© 2016 MapQuest, Inc."
},
"statuscode": 0,
"messages": []
}
}
So for some reason, Saturday at noon has the same travel times as Tuesday at 16:30. Is there something wrong with my request, or does MapQuest not actually have this capability for the Route Matrix? The API documentation leads me to believe that the date/time options should work on any package in the Directions API, so could someone clear this up? Thanks in advance.
EDIT: I've made sure to try a route that I know for sure has HOV lanes that are restricted during the rush hour and not on the Saturday. I also tried enabling MapQuest's useTraffic parameter. Neither of these had any effect on the data. MapQuest states that useTraffic depends on availability of information, so I think I can only assume that it can't find information (which is strange, since I know that there is tons of data for this area). If anyone has any other ideas or explanations I'd be happy to hear.
MapQuest's Transit & Date/Time Routing "gives the user the ability to specify the time and date of a route, thus compensating for lanes that are HOV at specific times, timed-turned restrictions, and seasonal or specific day of the week closures." It does not account for specific time and date historic traffic. It works great for timed traffic restrictions though.