Running on Tesla V100, Ubuntu 18.04, built with latest dependencies.
Using modified Alturos.Yolo.
Important classes that produce the following output:
`public IEnumerable
{
if (!this._imageAnalyzer.IsValidImageFormat(imageData))
{
throw new Exception("Invalid image data, wrong image format");
}
var container = new BboxContainer();
var size = Marshal.SizeOf(imageData[0]) * imageData.Length;
var pnt = Marshal.AllocHGlobal(size);
try
{
// Copy the array to unmanaged memory.
Marshal.Copy(imageData, 0, pnt, imageData.Length);
var count = 0;
switch (this.DetectionSystem)
{
case DetectionSystem.CPU:
count = DetectImageCpu(pnt, imageData.Length, ref container);
break;
case DetectionSystem.GPU:
count = DetectImageGpu(pnt, imageData.Length, ref container);
break;
}
if (count == -1)
{
throw new NotImplementedException("C++ dll compiled incorrectly");
}
}
catch (Exception exception)
{
return null;
}
finally
{
// Free the unmanaged memory.
Marshal.FreeHGlobal(pnt);
}
return this.Convert(container);
}
private IEnumerable<YoloItem> Convert(BboxContainer container)
{
var yoloItems = new List<YoloItem>();
foreach (var item in container.candidates.Where(o => o.h > 0 || o.w > 0))
{
Console.WriteLine(item.obj_id);
//Console.WriteLine(item.track_id);
//if (!this._objectType.ContainsKey((int)item.obj_id)) continue;
var objectType = this._objectType[(int)item.obj_id];
var yoloItem = new YoloItem() { X = (int)item.x, Y = (int)item.y, Height = (int)item.h, Width = (int)item.w, Confidence = item.prob, Type = objectType };
yoloItems.Add(yoloItem);
}
return yoloItems;
}`
80 (TOTAL NUMBER OF READ CLASSES)
0 (PERSON)
0 (PERSON)
15 (WITHIN RANGE)
2143289344 (OUTSIDE 0-79 range)
Unhandled Exception: System.Collections.Generic.KeyNotFoundException: The given key '2143289344' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Alturos.Yolo.YoloWrapper.Convert(BboxContainer container)
at Alturos.Yolo.YoloWrapper.Detect(Byte[] imageData)
@nemesis567 Hi,
Try to use new file: https://github.com/AlexeyAB/darknet/blob/master/build/darknet/YoloWrapper.cs
With these changes: https://github.com/AlexeyAB/darknet/commit/ab9e891f60927c0be52fa883fcab1a1737ada3e7#diff-d117b3cef7ba40394975fbea3a499d79R31
Amazing, fast and effective. Was this the relevant change?
public float x_3d, y_3d, z_3d;
Amazing, fast and effective. Was this the relevant change?
Yes.
I also did this in the Alturos project.
Most helpful comment
I also did this in the Alturos project.