@@ -28,17 +28,17 @@ public class PredictHatCommand : IBasicCommand
28
28
29
29
internal static string IterationName = "" ;
30
30
private ScreenshotTrainingService _TrainHat ;
31
- private readonly HatDescriptionRepository _Repository ;
31
+ // private readonly HatDescriptionRepository _Repository;
32
32
private readonly IHubContext < ObsHub > _HubContext ;
33
33
34
- public PredictHatCommand ( IConfiguration configuration , ScreenshotTrainingService service , HatDescriptionRepository repository , IHubContext < ObsHub > hubContext )
34
+ public PredictHatCommand ( IConfiguration configuration , ScreenshotTrainingService service , IHubContext < ObsHub > hubContext )
35
35
{
36
36
_CustomVisionKey = configuration [ "AzureServices:HatDetection:Key" ] ;
37
37
_AzureEndpoint = configuration [ "AzureServices:HatDetection:CustomVisionEndpoint" ] ;
38
38
_TwitchChannel = configuration [ "StreamServices:Twitch:Channel" ] ;
39
39
_AzureProjectId = Guid . Parse ( configuration [ "AzureServices:HatDetection:ProjectId" ] ) ;
40
40
_TrainHat = service ;
41
- _Repository = repository ;
41
+ // _Repository = repository;
42
42
_HubContext = hubContext ;
43
43
}
44
44
@@ -86,13 +86,13 @@ public async Task Execute(IChatService chatService, string userName, ReadOnlyMem
86
86
87
87
if ( result . Predictions . Count ( b => b . Probability > 0.4d ) > 1 ) {
88
88
89
- var guess1Data = ( await _Repository . GetHatData ( bestMatch . TagName ) ) ;
90
- var guess2Data = ( await _Repository . GetHatData ( result . Predictions . OrderByDescending ( p => p . Probability ) . Skip ( 1 ) . First ( ) . TagName ) ) ;
89
+ var guess1Data = new HatData ( "" , "" ) ; // (await _Repository.GetHatData(bestMatch.TagName));
90
+ var guess2Data = new HatData ( "" , "" ) ; // (await _Repository.GetHatData(result.Predictions.OrderByDescending(p => p.Probability).Skip(1).First().TagName));
91
91
await chatService . SendMessageAsync ( $ "csharpGuess I'm not quite sure if this is { guess1Data . Name } ({ bestMatch . Probability . ToString ( "0.0%" ) } ) or { guess2Data . Name } ({ result . Predictions . OrderByDescending ( p => p . Probability ) . Skip ( 1 ) . First ( ) . Probability . ToString ( "0.0%" ) } )") ;
92
92
return ;
93
93
94
94
} else {
95
- var guessData = ( await _Repository . GetHatData ( bestMatch . TagName ) ) ;
95
+ var guessData = new HatData ( "" , "" ) ; // (await _Repository.GetHatData(bestMatch.TagName));
96
96
await chatService . SendMessageAsync ( $ "csharpGuess I'm not quite sure if this is { guessData . Name } ({ bestMatch . Probability . ToString ( "0.0%" ) } )") ;
97
97
return ;
98
98
}
@@ -103,7 +103,7 @@ public async Task Execute(IChatService chatService, string userName, ReadOnlyMem
103
103
return ;
104
104
}
105
105
106
- var hatData = ( await _Repository . GetHatData ( bestMatch . TagName ) ) ;
106
+ var hatData = new HatData ( "" , "" ) ; // (await _Repository.GetHatData(bestMatch.TagName));
107
107
var nameToReport = ( hatData == null ? bestMatch . TagName : ( string . IsNullOrEmpty ( hatData . Name ) ? bestMatch . TagName : hatData . Name ) ) ;
108
108
await chatService . SendMessageAsync ( $ "csharpClip I think (with { bestMatch . Probability . ToString ( "0.0%" ) } certainty) Jeff is currently wearing his { nameToReport } hat csharpClip") ;
109
109
if ( hatData != null && ! string . IsNullOrEmpty ( hatData . Description ) ) await chatService . SendMessageAsync ( hatData . Description ) ;
@@ -127,4 +127,7 @@ private async Task IdentifyIterationName()
127
127
128
128
}
129
129
}
130
+
131
+ internal record HatData ( string Name , string Description ) ;
132
+
130
133
}
0 commit comments