Last active
April 4, 2018 20:50
-
-
Save revodavid/074c97ac83d21096d3999224460d8dba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hotdog_predict <- function(imageURL, threshold = 0.5) { | |
predURL <- paste0(cvision_api_endpoint_pred, "/", cvision_id,"/url?", | |
"iterationId=",train.id, | |
"&application=R" | |
) | |
body.pred <- toJSON(list(Url=imageURL[1]), auto_unbox = TRUE) | |
APIresponse = POST(url = predURL, | |
content_type_json(), | |
add_headers(.headers= c('Prediction-key' = cvision_pred_key)), | |
body=body.pred, | |
encode="json") | |
content(APIresponse)$Predictions | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment