public static async Task <Detector> LoadAsync(string networkName, CancellationToken ct) { var core = new InferenceEngineCore(); try { return(await LoadAsync(core, networkName, ct)); } catch (Exception) { core.Dispose(); throw; } }
public Detector(string networkName) { var core = new InferenceEngineCore(); try { _network = new InferenceEngineNetwork(core, networkName); Core = core; } catch (Exception) { core.Dispose(); throw; } }