In order to add a new module, these are the recommended steps in order to develop it:
- Create a folder with its name in the
experimental/
module, e.g.,experimental/hair/
. - Implement all the functionality in one
Worker
. I.e., inherit fromWorker
and implement all the functionality on that class (copy the examples from any Worker subclass).- The first letter of the class name should be
W
(e.g.,WHairExtractor
). - To initially simplify development:
- Optionally (higher debug info), you might initially create the Worker as a non-templated class, assuming it uses std::shared_ptr<std::vectorop::Datum> instead of directly using a template class (following the
examples/tutorial_api_cpp
synchronous examples). While developing, templates provide more confusing debugging info. Turn the class into a template after being initially developed. - Optionally (for development speed), use op::Datum as unique argument of your auxiliary functions within that worker.
- Use the OpenPose Wrapper class in ThreadManagerMode::SingleThread mode (e.g., it allows you to directly use cv::imshow).
- If you are using your own custom Caffe -> initially change the Caffe for your version. It should directly work.
- Optionally (higher debug info), you might initially create the Worker as a non-templated class, assuming it uses std::shared_ptr<std::vectorop::Datum> instead of directly using a template class (following the
- Copy the design from
pose/WPoseExtractor
.
- The first letter of the class name should be
- To test it:
- Add the functionality to
Wrapper
, use theexperimental
namespace for the new Struct (e.g.,experimental::HairStruct
) that theWrapper
will use. Do not change any function name fromWrapper
, just add a newconfigure
, with the newHairStruct
or modify the existing ones without changing their names. - Add a demo (e.g.,
examples/openpose/rthair.cpp
) to test it.
- Add the functionality to
- Split the
Worker
into as many Workers as required. - If the Workers need extra data from
Datum
, simply add intoDatum
the new variables required (without removing/modifying any previous variables!). - Read also the release steps before starting this developping phase.
After the code is running and ready to be merged, in order to officially release the new module:
- Move the functionality of each
Worker
class to the non-template class (e.g.,WHairExtractor
toHairExtractor
).WHairExtractor
will simply wrapHairExtractor
. This will reduce compiling time for the user. See examples from other modules. - If you are using a custom Caffe version, move the custom code into the OpenPose library and change back Caffe to the default (most updated) version.
- Move the module from
experimental/hair/
tohair/
. - Remove
experimental
namespaces (e.g., fromWrapper
andHair
) and turn Workers into template classes. - Integrate the new flags to the OpenPose Demo in
examples/openpose/
and optionally add some tutorial examples inexamples/tutorial_api_cpp
.