mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-07 10:37:47 +08:00
GlobalDescriptor (PyDescriptor / netvlad) (#1163)
* First commit for pydescriptor * Fixed Python refactoring errors * GUI: added PyDescriptor parameters * reordered python3 includes * updated rtabmap_netvlad.py test main * fixed build from last merge * integrated https://github.com/introlab/rtabmap/pull/1255 * rescaled dot product result Closing https://github.com/introlab/rtabmap/issues/1105
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Python interface for python descriptors like:
|
||||
* - NetVLAD: https://github.com/uzh-rpg/netvlad_tf_open
|
||||
*/
|
||||
|
||||
#ifndef PYDESCRIPTOR_H
|
||||
#define PYDESCRIPTOR_H
|
||||
|
||||
#include <rtabmap/core/GlobalDescriptorExtractor.h>
|
||||
#include "rtabmap/core/PythonInterface.h"
|
||||
#include <Python.h>
|
||||
|
||||
namespace rtabmap
|
||||
{
|
||||
|
||||
class PyDescriptor : public GlobalDescriptorExtractor
|
||||
{
|
||||
public:
|
||||
PyDescriptor(const ParametersMap & parameters = ParametersMap());
|
||||
virtual ~PyDescriptor();
|
||||
|
||||
const std::string & path() const {return path_;}
|
||||
float dim() const {return dim_;}
|
||||
|
||||
virtual void parseParameters(const ParametersMap & parameters);
|
||||
virtual GlobalDescriptor extract(const SensorData & data) const;
|
||||
virtual GlobalDescriptorExtractor::Type getType() const {return kPyDescriptor;}
|
||||
|
||||
private:
|
||||
PyObject * pModule_;
|
||||
PyObject * pFunc_;
|
||||
std::string path_;
|
||||
int dim_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user