@@ -374,14 +374,13 @@ private void OnDetectFacesResponse(RESTConnector.Request req, RESTConnector.Resp
374
374
/// The maximum number of images is 10,000 images or 100 MB per .zip file.
375
375
///
376
376
/// Encode special characters in the file name in UTF-8.</param>
377
- /// <param name="positiveExamplesFilename">The filename for positiveExamples.</param>
378
377
/// <param name="negativeExamples">A .zip file of images that do not depict the visual subject of any of the
379
378
/// classes of the new classifier. Must contain a minimum of 10 images.
380
379
///
381
380
/// Encode special characters in the file name in UTF-8. (optional)</param>
382
381
/// <param name="negativeExamplesFilename">The filename for negativeExamples. (optional)</param>
383
382
/// <returns><see cref="Classifier" />Classifier</returns>
384
- public bool CreateClassifier ( Callback < Classifier > callback , string name , Dictionary < string , System . IO . MemoryStream > positiveExamples , string positiveExamplesFilename , System . IO . MemoryStream negativeExamples = null , string negativeExamplesFilename = null )
383
+ public bool CreateClassifier ( Callback < Classifier > callback , string name , Dictionary < string , System . IO . MemoryStream > positiveExamples , System . IO . MemoryStream negativeExamples = null , string negativeExamplesFilename = null )
385
384
{
386
385
if ( callback == null )
387
386
throw new ArgumentNullException ( "`callback` is required for `CreateClassifier`" ) ;
@@ -391,8 +390,6 @@ public bool CreateClassifier(Callback<Classifier> callback, string name, Diction
391
390
throw new ArgumentNullException ( "`positiveExamples` is required for `CreateClassifier`" ) ;
392
391
if ( positiveExamples . Count == 0 )
393
392
throw new ArgumentException ( "`positiveExamples` must contain at least one dictionary entry" ) ;
394
- if ( string . IsNullOrEmpty ( positiveExamplesFilename ) )
395
- throw new ArgumentNullException ( "`positiveExamplesFilename` is required for `CreateClassifier`" ) ;
396
393
397
394
RequestObject < Classifier > req = new RequestObject < Classifier >
398
395
{
@@ -592,19 +589,16 @@ private void OnGetClassifierResponse(RESTConnector.Request req, RESTConnector.Re
592
589
}
593
590
response . StatusCode = resp . HttpResponseCode ;
594
591
595
- if ( resp . Success )
592
+ try
596
593
{
597
- try
598
- {
599
- string json = Encoding . UTF8 . GetString ( resp . Data ) ;
600
- response . Result = JsonConvert . DeserializeObject < Classifier > ( json ) ;
601
- response . Response = json ;
602
- }
603
- catch ( Exception e )
604
- {
605
- Log . Error ( "VisualRecognitionService.OnGetClassifierResponse()" , "Exception: {0}" , e . ToString ( ) ) ;
606
- resp . Success = false ;
607
- }
594
+ string json = Encoding . UTF8 . GetString ( resp . Data ) ;
595
+ response . Result = JsonConvert . DeserializeObject < Classifier > ( json ) ;
596
+ response . Response = json ;
597
+ }
598
+ catch ( Exception e )
599
+ {
600
+ Log . Error ( "VisualRecognitionService.OnGetClassifierResponse()" , "Exception: {0}" , e . ToString ( ) ) ;
601
+ resp . Success = false ;
608
602
}
609
603
610
604
if ( ( ( RequestObject < Classifier > ) req ) . Callback != null )
@@ -710,14 +704,13 @@ private void OnListClassifiersResponse(RESTConnector.Request req, RESTConnector.
710
704
/// The maximum number of images is 10,000 images or 100 MB per .zip file.
711
705
///
712
706
/// Encode special characters in the file name in UTF-8. (optional)</param>
713
- /// <param name="positiveExamplesFilename">The filename for positiveExamples. (optional)</param>
714
707
/// <param name="negativeExamples">A .zip file of images that do not depict the visual subject of any of the
715
708
/// classes of the new classifier. Must contain a minimum of 10 images.
716
709
///
717
710
/// Encode special characters in the file name in UTF-8. (optional)</param>
718
711
/// <param name="negativeExamplesFilename">The filename for negativeExamples. (optional)</param>
719
712
/// <returns><see cref="Classifier" />Classifier</returns>
720
- public bool UpdateClassifier ( Callback < Classifier > callback , string classifierId , Dictionary < string , System . IO . MemoryStream > positiveExamples = null , string positiveExamplesFilename = null , System . IO . MemoryStream negativeExamples = null , string negativeExamplesFilename = null )
713
+ public bool UpdateClassifier ( Callback < Classifier > callback , string classifierId , Dictionary < string , System . IO . MemoryStream > positiveExamples = null , System . IO . MemoryStream negativeExamples = null , string negativeExamplesFilename = null )
721
714
{
722
715
if ( callback == null )
723
716
throw new ArgumentNullException ( "`callback` is required for `UpdateClassifier`" ) ;
0 commit comments