Research is about doing things in new ways.
This brings a tension in how to create abstractions in code,
which is a challenge for any research engineering project of a significant size:
On one hand, it needs to have very thin abstractions to allow for the possibility of doing
everything in new ways. It should be reasonably easy to break existing
abstractions and replace them with new ones.
On the other hand, such a project also needs reasonably high-level
abstractions, so that users can easily do things in standard ways,
without worrying too much about the details that only certain researchers care about.
In detectron2, there are two types of interfaces that address this tension together:
Functions and classes that take only a "config" argument (optionally with a minimal
set of extra arguments in cases of mature interfaces).
Such functions and classes implement
the "standard default" behavior: it will read what it needs from the
config and do the "standard" thing.
Users only need to load a standard config and pass it around, without having to worry about
which arguments are used and what they all mean.
Functions and classes that have well-defined explicit arguments.
Each of these is a small building block of the entire system.
They require users' effort to stitch together, but can be stitched together in more flexible ways.
When you need to implement something different from the "standard defaults"
included in detectron2, these well-defined components can be reused.
If you only need the standard behavior, the Beginner's Tutorial
should suffice. If you need to extend detectron2 to your own needs,
see the following tutorials for more details: