Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Faster R-CNN object detector implemented in PyTorch and TensorFlow 2 (github.com/trzy)
15 points by trzy on Jan 28, 2022 | hide | past | favorite | 2 comments
Fresh and (I think) clean implementations of Faster R-CNN in PyTorch and TensorFlow 2/Keras.

I wanted to learn about object detectors and decided to understand and implement a foundational model in the field, Faster R-CNN (elements of which are still used in modern models to this day), using the paper alone. That proved to be more difficult than expected and I had to relent and take a peak at existing implementations to fill in some important gaps. I've documented my struggles and learnings in the README for others to benefit from.

I also wanted to solidify my understanding of TensorFlow/Keras and learn PyTorch, so I made sure to implement the model in both. Faster R-CNN is fairly challenging in that it doesn't quite map to Keras tutorial examples. For example, losses are not computed simply as a function of model output and input but rather, some of the training data is actually computed on-the-fly within the model during training and the losses have to explicitly be constructed as part of the graph.

Personally, I found the "official" TensorFlow reference implementation (https://github.com/tensorflow/models/blob/master/research/ob...) to be very difficult to follow and I hope this proves to be useful to learners like myself.




Great share! Your README is better than 99% of the repos I’ve seen in CV. And kudos for implementing it in both TF and PyTorch!


Thanks! It was a surprising amount of effort to get it working and I didn’t want to skimp on the docs :)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: