提交 25d021e7 编写于 作者: G gineshidalgo99

Removed all sign warnings

上级 02354bb3
......@@ -53,7 +53,7 @@ class Blob {
void ReshapeLike(const Blob& other);
inline string shape_string() const {
ostringstream stream;
for (int i = 0; i < shape_.size(); ++i) {
for (auto i = 0u; i < shape_.size(); ++i) {
stream << shape_[i] << " ";
}
stream << "(" << count_ << ")";
......
......@@ -169,7 +169,10 @@ ifeq ($(USE_OPENCV), 1)
endif
endif
WARNINGS := -Wall -Wno-sign-compare
##############################
# OpenPose extra code: commented
##############################
# WARNINGS := -Wall -Wno-sign-compare
##############################
# Set build directories
......
......@@ -105,5 +105,6 @@ OpenPose Library - Release Notes
## Current version (future OpenPose 1.0.3)
1. Main improvements:
1. Added how to use keypoint data in `examples/tutorial_wrapper/`.
2. Added flag for warnings of type `-Wsign-compare` and removed in code.
2. Main bugs fixed:
1. Windows version crashing with std::map copy.
......@@ -185,7 +185,7 @@ namespace op
{
spWPoses.resize(gpuNumber);
const auto handDetector = std::make_shared<HandDetectorFromTxt>(handGroundTruth);
for (auto gpuId = 0; gpuId < spWPoses.size(); gpuId++)
for (auto gpuId = 0u; gpuId < spWPoses.size(); gpuId++)
{
// Hand detector
// If tracking
......
......@@ -59,7 +59,7 @@ namespace op
auto& tDatumsNoPtr = *tDatums;
// Record people face keypoint data
std::vector<Array<float>> keypointVector(tDatumsNoPtr.size());
for (auto i = 0; i < tDatumsNoPtr.size(); i++)
for (auto i = 0u; i < tDatumsNoPtr.size(); i++)
keypointVector[i] = tDatumsNoPtr[i].faceKeypoints;
const auto fileName = (!tDatumsNoPtr[0].name.empty() ? tDatumsNoPtr[0].name : std::to_string(tDatumsNoPtr[0].id));
spKeypointSaver->saveKeypoints(keypointVector, fileName, "face");
......
......@@ -61,11 +61,11 @@ namespace op
const auto fileName = (!tDatumsNoPtr[0].name.empty() ? tDatumsNoPtr[0].name : std::to_string(tDatumsNoPtr[0].id));
std::vector<Array<float>> keypointVector(tDatumsNoPtr.size());
// Left hand
for (auto i = 0; i < tDatumsNoPtr.size(); i++)
for (auto i = 0u; i < tDatumsNoPtr.size(); i++)
keypointVector[i] = tDatumsNoPtr[i].handKeypoints[0];
spKeypointSaver->saveKeypoints(keypointVector, fileName, "hand_left");
// Right hand
for (auto i = 0; i < tDatumsNoPtr.size(); i++)
for (auto i = 0u; i < tDatumsNoPtr.size(); i++)
keypointVector[i] = tDatumsNoPtr[i].handKeypoints[1];
spKeypointSaver->saveKeypoints(keypointVector, fileName, "hand_right");
// Profiling speed
......
......@@ -58,7 +58,7 @@ namespace op
auto& tDatumsNoPtr = *tDatums;
// Record image(s) on disk
std::vector<Array<float>> poseHeatMaps(tDatumsNoPtr.size());
for (auto i = 0; i < tDatumsNoPtr.size(); i++)
for (auto i = 0u; i < tDatumsNoPtr.size(); i++)
poseHeatMaps[i] = tDatumsNoPtr[i].poseHeatMaps;
const auto fileName = (!tDatumsNoPtr[0].name.empty() ? tDatumsNoPtr[0].name : std::to_string(tDatumsNoPtr[0].id));
spHeatMapSaver->saveHeatMaps(poseHeatMaps, fileName);
......
......@@ -58,7 +58,7 @@ namespace op
auto& tDatumsNoPtr = *tDatums;
// Record image(s) on disk
std::vector<cv::Mat> cvOutputDatas(tDatumsNoPtr.size());
for (auto i = 0; i < tDatumsNoPtr.size(); i++)
for (auto i = 0u; i < tDatumsNoPtr.size(); i++)
cvOutputDatas[i] = tDatumsNoPtr[i].cvOutputData;
const auto fileName = (!tDatumsNoPtr[0].name.empty() ? tDatumsNoPtr[0].name : std::to_string(tDatumsNoPtr[0].id));
spImageSaver->saveImages(cvOutputDatas, fileName);
......
......@@ -59,7 +59,7 @@ namespace op
const auto baseFileName = (!tDatumFirst.name.empty() ? tDatumFirst.name
: std::to_string(tDatumFirst.id)) + "_keypoints";
const bool humanReadable = true;
for (auto i = 0 ; i < tDatums->size() ; i++)
for (auto i = 0u ; i < tDatums->size() ; i++)
{
const auto& tDatum = (*tDatums)[i];
// const auto fileName = baseFileName;
......
......@@ -59,7 +59,7 @@ namespace op
auto& tDatumsNoPtr = *tDatums;
// Record people pose keypoint data
std::vector<Array<float>> keypointVector(tDatumsNoPtr.size());
for (auto i = 0; i < tDatumsNoPtr.size(); i++)
for (auto i = 0u; i < tDatumsNoPtr.size(); i++)
keypointVector[i] = tDatumsNoPtr[i].poseKeypoints;
const auto fileName = (!tDatumsNoPtr[0].name.empty() ? tDatumsNoPtr[0].name : std::to_string(tDatumsNoPtr[0].id));
spKeypointSaver->saveKeypoints(keypointVector, fileName, "pose");
......
......@@ -58,7 +58,7 @@ namespace op
auto& tDatumsNoPtr = *tDatums;
// Record video(s)
std::vector<cv::Mat> cvOutputDatas(tDatumsNoPtr.size());
for (auto i = 0 ; i < cvOutputDatas.size() ; i++)
for (auto i = 0u ; i < cvOutputDatas.size() ; i++)
cvOutputDatas[i] = tDatumsNoPtr[i].cvOutputData;
spVideoSaver->write(cvOutputDatas);
// Profiling speed
......
......@@ -12,7 +12,7 @@ namespace op
class WQueueOrderer : public Worker<TDatums>
{
public:
explicit WQueueOrderer(const int maxBufferSize = 64);
explicit WQueueOrderer(const unsigned int maxBufferSize = 64u);
void initializationOnThread();
......@@ -21,7 +21,7 @@ namespace op
void tryStop();
private:
const int mMaxBufferSize;
const unsigned int mMaxBufferSize;
bool mStopWhenEmpty;
unsigned long long mNextExpectedId;
std::priority_queue<TDatums, std::vector<TDatums>, PointerContainerGreater<TDatums>> mPriorityQueueBuffer;
......@@ -40,7 +40,7 @@ namespace op
namespace op
{
template<typename TDatums>
WQueueOrderer<TDatums>::WQueueOrderer(const int maxBufferSize) :
WQueueOrderer<TDatums>::WQueueOrderer(const unsigned int maxBufferSize) :
mMaxBufferSize{maxBufferSize},
mStopWhenEmpty{false},
mNextExpectedId{0}
......@@ -99,7 +99,7 @@ namespace op
mNextExpectedId = tDatumsNoPtr[0].id + 1;
}
// Sleep if no new tDatums to either pop
if (!checkNoNullNorEmpty(tDatums) && mPriorityQueueBuffer.size() < mMaxBufferSize / 2)
if (!checkNoNullNorEmpty(tDatums) && mPriorityQueueBuffer.size() < mMaxBufferSize / 2u)
std::this_thread::sleep_for(std::chrono::milliseconds{1});
// If TDatum popped and/or pushed
if (profileSpeed || tDatums != nullptr)
......
......@@ -589,7 +589,7 @@ namespace op
// GPU rendering
if (renderOutputGpu)
{
for (auto gpuId = 0; gpuId < poseExtractors.size(); gpuId++)
for (auto gpuId = 0u; gpuId < poseExtractors.size(); gpuId++)
{
poseRenderers.emplace_back(std::make_shared<PoseRenderer>(
poseNetOutputSize, finalOutputSize, wrapperStructPose.poseModel, poseExtractors[gpuId],
......@@ -621,14 +621,14 @@ namespace op
// Pose extractor(s)
spWPoses.resize(poseExtractors.size());
for (auto i = 0; i < spWPoses.size(); i++)
for (auto i = 0u; i < spWPoses.size(); i++)
spWPoses.at(i) = {std::make_shared<WPoseExtractor<TDatumsPtr>>(poseExtractors.at(i))};
// Face extractor(s)
if (wrapperStructFace.enable)
{
const auto faceDetector = std::make_shared<FaceDetector>(wrapperStructPose.poseModel);
for (auto gpuId = 0; gpuId < spWPoses.size(); gpuId++)
for (auto gpuId = 0u; gpuId < spWPoses.size(); gpuId++)
{
// Face detector
spWPoses.at(gpuId).emplace_back(std::make_shared<WFaceDetector<TDatumsPtr>>(faceDetector));
......@@ -645,7 +645,7 @@ namespace op
if (wrapperStructHand.enable)
{
const auto handDetector = std::make_shared<HandDetector>(wrapperStructPose.poseModel);
for (auto gpuId = 0; gpuId < spWPoses.size(); gpuId++)
for (auto gpuId = 0u; gpuId < spWPoses.size(); gpuId++)
{
// Hand detector
// If tracking
......@@ -669,7 +669,7 @@ namespace op
// Pose renderer(s)
if (!poseRenderers.empty())
for (auto i = 0; i < spWPoses.size(); i++)
for (auto i = 0u; i < spWPoses.size(); i++)
spWPoses.at(i).emplace_back(std::make_shared<WPoseRenderer<TDatumsPtr>>(poseRenderers.at(i)));
// Face renderer(s)
......@@ -689,7 +689,7 @@ namespace op
// GPU rendering
else if (wrapperStructFace.renderMode == RenderMode::Gpu)
{
for (auto i = 0; i < spWPoses.size(); i++)
for (auto i = 0u; i < spWPoses.size(); i++)
{
// Construct face renderer
const auto faceRenderer = std::make_shared<FaceRenderer>(finalOutputSize, wrapperStructFace.renderThreshold,
......@@ -727,7 +727,7 @@ namespace op
// GPU rendering
else if (wrapperStructHand.renderMode == RenderMode::Gpu)
{
for (auto i = 0; i < spWPoses.size(); i++)
for (auto i = 0u; i < spWPoses.size(); i++)
{
// Construct hands renderer
const auto handRenderer = std::make_shared<HandRenderer>(finalOutputSize, wrapperStructHand.renderThreshold,
......@@ -751,7 +751,7 @@ namespace op
// Itermediate workers (e.g. OpenPose format to cv::Mat, json & frames recorder, ...)
mPostProcessingWs.clear();
// Frame buffer and ordering
if (spWPoses.size() > 1)
if (spWPoses.size() > 1u)
mPostProcessingWs.emplace_back(std::make_shared<WQueueOrderer<TDatumsPtr>>());
// Frames processor (OpenPose format -> cv::Mat format)
if (renderOutput)
......
......@@ -173,7 +173,7 @@ namespace op
else
{
mSize = {};
mVolume = 0;
mVolume = 0ul;
spData.reset();
// cv::Mat available but empty
mCvMatData = std::make_pair(true, cv::Mat());
......@@ -222,7 +222,7 @@ namespace op
{
// New size
std::vector<int> newSize(cvMat.dims,0);
for (auto i = 0 ; i < newSize.size() ; i++)
for (auto i = 0u ; i < newSize.size() ; i++)
newSize[i] = cvMat.size[i];
// Reset data & volume
reset(newSize);
......@@ -252,7 +252,7 @@ namespace op
if (mCvMatData.first)
mCvMatData.second.setTo((double)value);
else
for (auto i = 0 ; i < mVolume ; i++)
for (auto i = 0u ; i < mVolume ; i++)
operator[](i) = value;
}
}
......@@ -270,12 +270,12 @@ namespace op
// Matlab style:
// If empty -> return 0
// If index >= # dimensions -> return 1
if (index < mSize.size() && 0 <= index)
if ((unsigned int)index < mSize.size() && 0 <= index)
return mSize[index];
// Long version:
// else if (mSize.empty())
// return 0;
// else // if mSize.size() <= index
// else // if mSize.size() <= (unsigned int)index
// return 1;
// Equivalent to:
else
......@@ -295,7 +295,7 @@ namespace op
{
if (indexA < indexB)
{
if (0 <= indexA && indexB < mSize.size()) // 0 <= indexA < indexB < mSize.size()
if (0 <= indexA && (unsigned int)indexB < mSize.size()) // 0 <= indexA < indexB < mSize.size()
return std::accumulate(mSize.begin()+indexA, mSize.begin()+indexB+1, 1ul, std::multiplies<size_t>());
else
{
......@@ -358,14 +358,14 @@ namespace op
// Initial value
std::string string{"Array<T>::toString():\n"};
// Add each element
for (auto i = 0 ; i < mVolume ; i++)
for (auto i = 0u ; i < mVolume ; i++)
{
// Adding element sepearted by an space
string += std::to_string(spData[i]) + " ";
// Introduce an enter for each dimension change
// If comented, all values will be printed in the same line
auto multiplier = 1;
for (auto dimension = (int)(mSize.size() - 1u) ; dimension > 0 && ((i/multiplier) % getSize(dimension) == getSize(dimension)-1) ; dimension--)
for (auto dimension = (int)(mSize.size() - 1u) ; dimension > 0 && (int(i/multiplier) % getSize(dimension) == getSize(dimension)-1) ; dimension--)
{
string += "\n";
multiplier *= getSize(dimension);
......@@ -423,7 +423,7 @@ namespace op
{
try
{
if (0 <= index && index < mVolume)
if (0 <= index && (size_t)index < mVolume)
return spData[index];
else
{
......
......@@ -63,7 +63,7 @@ namespace op
mJsonOfstream.key("keypoints");
mJsonOfstream.arrayOpen();
const std::vector<int> indexesInCocoOrder{0, 15, 14, 17, 16, 5, 2, 6, 3, 7, 4, 11, 8, 12, 9, 13, 10};
for (auto bodyPart = 0 ; bodyPart < indexesInCocoOrder.size() ; bodyPart++)
for (auto bodyPart = 0u ; bodyPart < indexesInCocoOrder.size() ; bodyPart++)
{
const auto finalIndex = 3*(person*numberBodyParts + indexesInCocoOrder.at(bodyPart));
mJsonOfstream.plainText(poseKeypoints[finalIndex]);
......@@ -71,7 +71,7 @@ namespace op
mJsonOfstream.plainText(poseKeypoints[finalIndex+1]);
mJsonOfstream.comma();
mJsonOfstream.plainText(1);
if (bodyPart < indexesInCocoOrder.size() - 1)
if (bodyPart < indexesInCocoOrder.size() - 1u)
mJsonOfstream.comma();
}
mJsonOfstream.arrayClose();
......
......@@ -82,7 +82,7 @@ namespace op
error("cvMats.size() != cvMatNames.size()", __LINE__, __FUNCTION__, __FILE__);
// Save cv::Mat data
cv::FileStorage fileStorage{getFullName(fileNameNoExtension, format), cv::FileStorage::WRITE};
for (auto i = 0 ; i < cvMats.size() ; i++)
for (auto i = 0u ; i < cvMats.size() ; i++)
fileStorage << cvMatNames[i] << (cvMats[i].empty() ? cv::Mat() : cvMats[i]);
// Release file
fileStorage.release();
......@@ -114,7 +114,7 @@ namespace op
cv::FileStorage fileStorage{getFullName(fileNameNoExtension, format), cv::FileStorage::READ};
std::vector<cv::Mat> cvMats(cvMatNames.size());
for (auto i = 0 ; i < cvMats.size() ; i++)
for (auto i = 0u ; i < cvMats.size() ; i++)
fileStorage[cvMatNames[i]] >> cvMats[i];
fileStorage.release();
return cvMats;
......@@ -171,12 +171,12 @@ namespace op
jsonOfstream.arrayOpen();
// Ger max numberPeople
auto numberPeople = 0;
for (auto vectorIndex = 0 ; vectorIndex < keypointVector.size() ; vectorIndex++)
for (auto vectorIndex = 0u ; vectorIndex < keypointVector.size() ; vectorIndex++)
numberPeople = fastMax(numberPeople, keypointVector[vectorIndex].first.getSize(0));
for (auto person = 0 ; person < numberPeople ; person++)
{
jsonOfstream.objectOpen();
for (auto vectorIndex = 0 ; vectorIndex < keypointVector.size() ; vectorIndex++)
for (auto vectorIndex = 0u ; vectorIndex < keypointVector.size() ; vectorIndex++)
{
const auto& keypoints = keypointVector[vectorIndex].first;
const auto& keypointName = keypointVector[vectorIndex].second;
......@@ -262,7 +262,7 @@ namespace op
std::vector<float> splittedInts;
for (auto splittedString : splittedStrings)
splittedInts.emplace_back(std::stof(splittedString));
if (splittedInts.size() != 4)
if (splittedInts.size() != 4u)
error("splittedInts.size() != 4, but splittedInts.size() = "
+ std::to_string(splittedInts.size()) + ".", __LINE__, __FUNCTION__, __FILE__);
const Rectangle<float> handRectangleZero;
......
......@@ -31,16 +31,16 @@ namespace op
// Get names for each heatMap
std::vector<std::string> fileNames(heatMaps.size());
for (auto i = 0; i < fileNames.size(); i++)
for (auto i = 0u; i < fileNames.size(); i++)
fileNames[i] = {fileNameNoExtension + (i != 0 ? "_" + std::to_string(i) : "") + "." + mImageFormat};
// heatMaps -> cvOutputDatas
std::vector<cv::Mat> cvOutputDatas(heatMaps.size());
for (auto i = 0; i < cvOutputDatas.size(); i++)
for (auto i = 0u; i < cvOutputDatas.size(); i++)
unrollArrayToUCharCvMat(cvOutputDatas[i], heatMaps[i]);
// Save each heatMap
for (auto i = 0; i < cvOutputDatas.size(); i++)
for (auto i = 0u; i < cvOutputDatas.size(); i++)
saveImage(cvOutputDatas[i], fileNames[i]);
}
}
......
......@@ -30,11 +30,11 @@ namespace op
// Get names for each image
std::vector<std::string> fileNames(cvOutputDatas.size());
for (auto i = 0; i < fileNames.size(); i++)
for (auto i = 0u; i < fileNames.size(); i++)
fileNames[i] = {fileNameNoExtension + (i != 0 ? "_" + std::to_string(i) : "") + "." + mImageFormat};
// Save each image
for (auto i = 0; i < cvOutputDatas.size(); i++)
for (auto i = 0u; i < cvOutputDatas.size(); i++)
saveImage(cvOutputDatas[i], fileNames[i]);
}
}
......
......@@ -20,12 +20,12 @@ namespace op
// Get vector of people poses
std::vector<cv::Mat> cvMatPoses(keypointVector.size());
for (auto i = 0; i < keypointVector.size(); i++)
for (auto i = 0u; i < keypointVector.size(); i++)
cvMatPoses[i] = keypointVector[i].getConstCvMat();
// Get names inside file
std::vector<std::string> keypointVectorNames(cvMatPoses.size());
for (auto i = 0; i < cvMatPoses.size(); i++)
for (auto i = 0u; i < cvMatPoses.size(); i++)
keypointVectorNames[i] = {keypointName + "_" + std::to_string(i)};
// Record people poses in desired format
......
......@@ -79,7 +79,7 @@ namespace op
if (cvMats.size() != mVideoWriters.size())
error("Size cvMats != size video writers");
for (auto i = 0 ; i < mVideoWriters.size() ; i++)
for (auto i = 0u ; i < mVideoWriters.size() ; i++)
mVideoWriters[i].write(cvMats[i]);
}
catch (const std::exception& e)
......
......@@ -94,7 +94,7 @@ namespace op
// Find closest previous rectangle
auto maxIndex = -1;
auto maxValue = 0.f;
for (auto previous = 0 ; previous < previousHands.size() ; previous++)
for (auto previous = 0u ; previous < previousHands.size() ; previous++)
{
const auto areaRatio = getAreaRatio(currentRectangle, previousHands[previous]);
if (maxValue < areaRatio)
......@@ -169,11 +169,8 @@ namespace op
// Baseline detectHands
auto handRectangles = detectHands(poseKeypoints, scaleInputToOutput);
// If previous hands saved
// for (auto current = 0 ; current < handRectangles.size() ; current++)
for (auto& handRectangle : handRectangles)
{
// trackHand(handRectangles[current][0], mHandLeftPrevious);
// trackHand(handRectangles[current][1], mHandRightPrevious);
trackHand(handRectangle[0], mHandLeftPrevious);
trackHand(handRectangle[1], mHandRightPrevious);
}
......@@ -203,7 +200,7 @@ namespace op
mPoseTrack.resize(numberPeople);
mHandLeftPrevious.clear();
mHandRightPrevious.clear();
for (auto person = 0 ; person < mPoseTrack.size() ; person++)
for (auto person = 0u ; person < mPoseTrack.size() ; person++)
{
const auto scoreThreshold = 0.66667f;
// Left hand
......@@ -234,7 +231,7 @@ namespace op
) const
{
std::array<unsigned int, (int)PosePart::Size> poseKeypoints;
for (auto i = 0 ; i < poseKeypoints.size() ; i++)
for (auto i = 0u ; i < poseKeypoints.size() ; i++)
poseKeypoints.at(i) = poseBodyPartMapStringToKey(poseModel, poseStrings.at(i));
return poseKeypoints;
}
......
......@@ -25,7 +25,7 @@ namespace op
const auto peaksOffset = 3*(maxPeaks+1);
const auto heatMapOffset = heatMapSize.area();
for (auto pairIndex = 0; pairIndex < numberBodyPartPairs; pairIndex++)
for (auto pairIndex = 0u; pairIndex < numberBodyPartPairs; pairIndex++)
{
const auto bodyPartA = bodyPartPairs[2*pairIndex];
const auto bodyPartB = bodyPartPairs[2*pairIndex+1];
......@@ -46,7 +46,7 @@ namespace op
{
bool num = false;
const auto indexB = bodyPartB;
for (auto j = 0; j < subset.size(); j++)
for (auto j = 0u; j < subset.size(); j++)
{
const auto off = (int)bodyPartB*peaksOffset + i*3 + 2;
if (subset[j].first[indexB] == off)
......@@ -87,7 +87,7 @@ namespace op
{
bool num = false;
const auto indexA = bodyPartA;
for (auto j = 0; j < subset.size(); j++)
for (auto j = 0u; j < subset.size(); j++)
{
const auto off = (int)bodyPartA*peaksOffset + i*3 + 2;
if (subset[j].first[indexA] == off)
......@@ -177,7 +177,7 @@ namespace op
std::vector<int> occurA(nA, 0);
std::vector<int> occurB(nB, 0);
auto counter = 0;
for (auto row = 0; row < temp.size(); row++)
for (auto row = 0u; row < temp.size(); row++)
{
const auto score = std::get<0>(temp[row]);
const auto x = std::get<1>(temp[row]);
......@@ -236,13 +236,13 @@ namespace op
if (!connectionK.empty())
{
// A is already in the subset, find its connection B
for (auto i = 0; i < connectionK.size(); i++)
for (auto i = 0u; i < connectionK.size(); i++)
{
const auto indexA = std::get<0>(connectionK[i]);
const auto indexB = std::get<1>(connectionK[i]);
const auto score = std::get<2>(connectionK[i]);
auto num = 0;
for (auto j = 0; j < subset.size(); j++)
for (auto j = 0u; j < subset.size(); j++)
{
if (subset[j].first[bodyPartA] == indexA)
{
......@@ -275,7 +275,7 @@ namespace op
auto numberPeople = 0;
std::vector<int> validSubsetIndexes;
validSubsetIndexes.reserve(fastMin((size_t)POSE_MAX_PEOPLE, subset.size()));
for (auto index = 0 ; index < subset.size() ; index++)
for (auto index = 0u ; index < subset.size() ; index++)
{
const auto subsetCounter = subset[index].first[subsetCounterIndex];
const auto subsetScore = subset[index].second;
......@@ -295,7 +295,7 @@ namespace op
poseKeypoints.reset({numberPeople, (int)numberBodyParts, 3});
else
poseKeypoints.reset();
for (auto person = 0 ; person < validSubsetIndexes.size() ; person++)
for (auto person = 0u ; person < validSubsetIndexes.size() ; person++)
{
const auto& subsetI = subset[validSubsetIndexes[person]].first;
for (auto bodyPart = 0u; bodyPart < numberBodyParts; bodyPart++)
......
......@@ -19,7 +19,7 @@ namespace op
const auto& bodyPartPairs = POSE_BODY_PART_PAIRS[(int)poseModel];
const auto& mapIdx = POSE_MAP_IDX[(int)poseModel];
for (auto bodyPart = 0; bodyPart < bodyPartPairs.size(); bodyPart+=2)
for (auto bodyPart = 0u; bodyPart < bodyPartPairs.size(); bodyPart+=2)
{
const auto bodyPartPairsA = bodyPartPairs.at(bodyPart);
const auto bodyPartPairsB = bodyPartPairs.at(bodyPart+1);
......
......@@ -30,7 +30,7 @@ namespace op
// Security checks
if (keypointsA.getNumberDimensions() != keypointsB.getNumberDimensions())
error("keypointsA.getNumberDimensions() != keypointsB.getNumberDimensions().", __LINE__, __FUNCTION__, __FILE__);
for (auto dimension = 1 ; dimension < keypointsA.getNumberDimensions() ; dimension++)
for (auto dimension = 1u ; dimension < keypointsA.getNumberDimensions() ; dimension++)
if (keypointsA.getSize(dimension) != keypointsB.getSize(dimension))
error("keypointsA.getSize() != keypointsB.getSize().", __LINE__, __FUNCTION__, __FILE__);
// For each body part
......@@ -172,7 +172,7 @@ namespace op
const auto radius = thicknessRatio / 2;
// Draw lines
for (auto pair = 0 ; pair < pairs.size() ; pair+=2)
for (auto pair = 0u ; pair < pairs.size() ; pair+=2)
{
const auto index1 = (person * numberKeypoints + pairs[pair]) * keypoints.getSize(2);
const auto index2 = (person * numberKeypoints + pairs[pair+1]) * keypoints.getSize(2);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册