How to train a bounding box detection model?

Apparently, this still isn't possible in v12?

I'd like to add a new class to one of the standard object detection architectures. Consider the YOLO v2 detector from the Neural Net Repo.

NetModel["YOLO V2 Trained on MS-COCO Data"]


Which currently has 80 classes:

labels = {"person", "bicycle", "car", "motorcycle", "airplane", "bus",
"train", "truck", "boat", "traffic light", "fire hydrant",
"stop sign", "parking meter", "bench", "bird", "cat", "dog",
"horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe",
"backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee",
"skis", "snowboard", "sports ball", "kite", "baseball bat",
"baseball glove", "skateboard", "surfboard", "tennis racket",
"bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl",
"banana", "apple", "sandwich", "orange", "broccoli", "carrot",
"hot dog", "pizza", "donut", "cake", "chair", "couch",
"potted plant", "bed", "dining table", "toilet", "tv", "laptop",
"mouse", "remote", "keyboard", "cell phone", "microwave", "oven",
"toaster", "sink", "refrigerator", "book", "clock", "vase",
"scissors", "teddy bear", "hair drier", "toothbrush"};


As a minimal workable example, here is a toy set of training data for an additional class 'Fish', consisting of image and bounding-box coordinate pairs:

{fish, bboxes} =
CloudGet @ CloudObject[
"https://www.wolframcloud.com/objects/9c57ab39-52e2-40d3-84e6-80c9ee9a42a4"];
HighlightImage[fish[[1]], Rectangle @@ bboxes[[1]]]


Unfortunately, I can't find any information on the training net:

I also looked on the community but couldn't find any guidance for NetTrain'ing bounding box detection networks.

References:

This question has an open bounty worth +200 reputation from M.R. ending in 4 days.

Looking for an answer drawing from credible and/or official sources.

• I can change the to allow for any architecture, Yolo v2 is actually old anyway. – M.R. Mar 28 at 19:16
• @C.E. And it is always possible that someone else on SE knows or a developer might be about to answer with a short tutorial. – M.R. Mar 28 at 19:25
• I and a colleague have been working on implementing the training version of the Yolo 2 for a while (it's a complicated loss function) but haven't successfully got NetTrain to run, a divergence error arises. I have been in contact with WRI about the error but not solution yet. It was mentioned in passing by them that the weights were imported rather than training the net in MMA . If anyone is interested in comparing notes on building the training version of Yolo 2 I'd be open to sharing what we've done so far. – EstabanW Mar 28 at 23:15
• @M.R. I'm going to wait for version 12 to be released (imminent I think) and test our training version of Yolo 2 on that. I would consider posting the code on Github if there's interest from others in it, interested? – EstabanW Apr 5 at 16:20
• @EstabanW sure thanks I’ll take a look – M.R. Apr 5 at 16:24