Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions python/kwiver/vital/types/descriptor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// OSI-approved BSD 3-Clause License. See top-level LICENSE file or
// https://github.com/Kitware/kwiver/blob/master/LICENSE for details.

#include <pybind11/cast.h>
#include <pybind11/stl.h>

#include <vital/types/descriptor.h>
Expand All @@ -17,12 +18,12 @@ new_descriptor(size_t len, char ctype)
if(ctype == 'd')
{
auto obj = std::shared_ptr<kwiver::vital::descriptor_dynamic<double>>(new kwiver::vital::descriptor_dynamic<double>(len));
retVal = py::cast<std::shared_ptr<kwiver::vital::descriptor_dynamic<double>>>(obj);
retVal = py::cast(obj);
}
else if(ctype == 'f')
{
auto obj = std::shared_ptr<kwiver::vital::descriptor_dynamic<float>>(new kwiver::vital::descriptor_dynamic<float>(len));
retVal = py::cast<std::shared_ptr<kwiver::vital::descriptor_dynamic<float>>>(obj);
retVal = py::cast(obj);
}
return retVal;
}
Expand Down
4 changes: 2 additions & 2 deletions python/kwiver/vital/types/descriptor_class.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class PyDescriptorD
{
ret_vec.push_back(data[idx]);
}
return py::cast<std::vector<double>> (ret_vec);
return py::cast(ret_vec);
}

};
Expand Down Expand Up @@ -169,7 +169,7 @@ class PyDescriptorF
{
ret_vec.push_back(data[idx]);
}
return py::cast<std::vector<float>> (ret_vec);
return py::cast(ret_vec);
}
};

Expand Down
3 changes: 2 additions & 1 deletion python/kwiver/vital/types/descriptor_set.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/Kitware/kwiver/blob/master/LICENSE for details.

#include <pybind11/pybind11.h>
#include <pybind11/cast.h>
#include <pybind11/stl.h>

#include <vital/types/descriptor_set.h>
Expand All @@ -29,7 +30,7 @@ new_desc_set1(py::list py_list)
std::vector<std::shared_ptr<kwiver::vital::descriptor>> desc_list;
for(auto py_desc : py_list)
{
desc_list.push_back(py::cast<std::shared_ptr<kwiver::vital::descriptor>>(py_desc));
desc_list.push_back(py_desc.cast<std::shared_ptr<kwiver::vital::descriptor>>());
}
return std::make_shared<s_desc_set>(desc_list);
}
Expand Down
5 changes: 3 additions & 2 deletions python/kwiver/vital/types/image.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <vital/types/image.h>
#include <python/kwiver/vital/types/image.h>
#include <pybind11/pybind11.h>
#include <pybind11/cast.h>
#include <pybind11/stl.h>
#include <pybind11/numpy.h>

Expand Down Expand Up @@ -65,7 +66,7 @@ kwiver::vital::python::image::get_pixel2(std::shared_ptr<image_t> &img,
#define QUOTE(X) #X
#define GET_PIXEL(TYPE, NAME) \
if(type == QUOTE(NAME)) \
return py::cast<TYPE>(img->at<TYPE>(i,j));
return py::cast(img->at<TYPE>(i,j));

GET_PIXEL(uint8_t, uint8)
GET_PIXEL(int8_t, int8)
Expand Down Expand Up @@ -96,7 +97,7 @@ kwiver::vital::python::image::get_pixel3(std::shared_ptr<image_t> &img,
#define QUOTE(X) #X
#define GET_PIXEL(TYPE, NAME) \
if(type == QUOTE(NAME)) \
return py::cast<TYPE>(img->at<TYPE>(i,j,k));
return py::cast(img->at<TYPE>(i,j,k));

GET_PIXEL(uint8_t, uint8)
GET_PIXEL(int8_t, int8)
Expand Down
3 changes: 2 additions & 1 deletion python/kwiver/vital/types/track.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/cast.h>

namespace py=pybind11;
namespace kwiver {
Expand All @@ -21,7 +22,7 @@ track_find_state(kwiver::vital::track &self, int64_t frame_id)
{
throw py::index_error();
}
return py::cast<std::shared_ptr<kwiver::vital::track_state>>(*frame_itr);
return py::cast(*frame_itr);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion python/kwiver/vital/util/pybind11.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class gil_scoped_release
if( pybind11::detail::cast_is_temporary_value_reference< ret_type >:: \
value ) \
{ \
static pybind11::detail::overload_caster_t< ret_type > caster; \
static pybind11::detail::override_caster_t< ret_type > caster; \
return pybind11::detail::cast_ref< ret_type >( std::move( o ), \
caster ); \
} \
Expand Down