What cause the error with code 404 ?
wang3t opened this issue · 6 comments
- Clone the repo.
- Insert subscription key for the Face API MPOAppDelegate.h (Verified @ 5)
- re-run pop install @ Cognitive-Face-iOS/Example
- run on device but seeing error while it detecting face at
- (void)detectAction: (id)sender {
=> [client detectWithData:data returnFaceId:YES ....] completionBlock:^() { ... }
}
- (void)detectAction: (id)sender {
- Verified EndPoint/Key
EndPpoin:https://westus.api.cognitive.microsoft.com/face/v1.0;
KEY:xxxx
error NSError * domain: @"POFaceServiceClient error - http response is not success : { "statusCode": 404, "message": "Resource not found" }" - code: 404 0x00000001c4251f70
- Before the error, there is another log
... ProjectOxfordFace_Example[299:14136] [discovery] errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}
Q: What cause the error with code 404 ?
Am I missing something (UserInfo?)
Found the issue, missing the closing "/".
Modified : EndPpoin:https://westus.api.cognitive.microsoft.com/face/v1.0/
Closing.
missing the closing "/"
It saved my life ;p
In python simply this worked for me.
ENDPOINT='https://westcentralus.api.cognitive.microsoft.com'
Even after putting slash in my endpoint at the end, I am still facing the issue.
Encountered exception. (404) Resource not found
I am having the same issue as well using the exact example and in westus and using the trailing "/" yet still I keep getting 404 Resource not found using Cognitive Services. I tried creating from Endpoint and from Subscription with the same error.
string subscriptionKey = _azuresubscriptionKey;
string region = _azureRegion;
var azureSpeechServiceUri = new Uri(_azureSpeechServicesPath);
// var config = SpeechConfig.FromSubscription(subscriptionKey, region);
var config = SpeechConfig.FromEndpoint(azureSpeechServiceUri, subscriptionKey);
config.SpeechRecognitionLanguage = "en-us";
// persist profileMapping if you want to store a record of who the profile is
var profileMapping = new Dictionary<string, string>();
await VerificationEnroll(config, profileMapping);
The createProfileAsync always returns an empty Profile Id.
var client = new VoiceProfileClient(config);
var profile = await client.CreateProfileAsync(VoiceProfileType.TextIndependentVerification, "en-us");
var audioInput = AudioConfig.FromDefaultMicrophoneInput();
CurrentInstructions.Text = $"Enrolling profile id {profile.Id}.";
// give the profile a human-readable display name
profileMapping.Add(profile.Id, "Mark");
VoiceProfileEnrollmentResult result = null;
while (result is null || result.RemainingEnrollmentsSpeechLength > TimeSpan.Zero)
{
CurrentInstructions.Text = "Continue speaking to add to the profile enrollment sample.";
result = await client.EnrollProfileAsync(profile, audioInput);
CurrentInstructions.Text = $"Remaining enrollment audio time needed: {result.RemainingEnrollmentsSpeechLength}";
}
if (result.Reason == ResultReason.EnrolledVoiceProfile)
{
await SpeakerVerify(config, profile, profileMapping);
}
else if (result.Reason == ResultReason.Canceled)
{
var cancellation = VoiceProfileEnrollmentCancellationDetails.FromResult(result);
CurrentInstructions.Text = $"CANCELED {profile.Id}: ErrorCode={cancellation.ErrorCode} ErrorDetails={cancellation.ErrorDetails}";
}