From 47af3a8f80c583429055d1957362b1a3d7e7ca8d Mon Sep 17 00:00:00 2001 From: Gines Hidalgo Date: Wed, 25 Sep 2019 00:26:42 -0400 Subject: [PATCH] Removed Windows warnings --- examples/openpose/openpose.cpp | 2 +- .../1_custom_post_processing.cpp | 2 +- .../01_body_from_image_default.cpp | 2 +- .../02_whole_body_from_image_default.cpp | 2 +- .../03_keypoints_from_image.cpp | 2 +- .../04_keypoints_from_images.cpp | 2 +- .../05_keypoints_from_images_multi_gpu.cpp | 2 +- .../tutorial_api_cpp/06_face_from_image.cpp | 2 +- .../tutorial_api_cpp/07_hand_from_image.cpp | 2 +- .../08_heatmaps_from_image.cpp | 2 +- .../09_keypoints_from_heatmaps.cpp | 2 +- .../10_asynchronous_custom_input.cpp | 2 +- .../11_asynchronous_custom_output.cpp | 2 +- ...chronous_custom_input_output_and_datum.cpp | 2 +- .../13_synchronous_custom_input.cpp | 2 +- .../14_synchronous_custom_preprocessing.cpp | 2 +- .../15_synchronous_custom_postprocessing.cpp | 2 +- .../16_synchronous_custom_output.cpp | 2 +- .../17_synchronous_custom_all_and_datum.cpp | 2 +- src/openpose/core/array.cpp | 2 +- src/openpose/core/keepTopNPeople.cpp | 2 +- src/openpose/filestream/cocoJsonSaver.cpp | 2 +- src/openpose/filestream/videoSaver.cpp | 20 +++++++++---------- src/openpose/net/resizeAndMergeBase.cu | 12 +++++------ src/openpose/pose/poseExtractorCaffe.cpp | 14 ++++++------- src/openpose/utilities/fileSystem.cpp | 4 ++-- src/openpose/utilities/keypoint.cpp | 6 +++--- 27 files changed, 50 insertions(+), 50 deletions(-) diff --git a/examples/openpose/openpose.cpp b/examples/openpose/openpose.cpp index fac94620..290d76d3 100755 --- a/examples/openpose/openpose.cpp +++ b/examples/openpose/openpose.cpp @@ -137,7 +137,7 @@ int openPoseDemo() // Return successful message return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_add_module/1_custom_post_processing.cpp b/examples/tutorial_add_module/1_custom_post_processing.cpp index 85ee15e9..30c42480 100644 --- a/examples/tutorial_add_module/1_custom_post_processing.cpp +++ b/examples/tutorial_add_module/1_custom_post_processing.cpp @@ -165,7 +165,7 @@ int tutorialAddModule1() // Return successful message return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/01_body_from_image_default.cpp b/examples/tutorial_api_cpp/01_body_from_image_default.cpp index bb0c0a23..d5977dcc 100644 --- a/examples/tutorial_api_cpp/01_body_from_image_default.cpp +++ b/examples/tutorial_api_cpp/01_body_from_image_default.cpp @@ -116,7 +116,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/02_whole_body_from_image_default.cpp b/examples/tutorial_api_cpp/02_whole_body_from_image_default.cpp index 756f0e8d..a6ad7adc 100644 --- a/examples/tutorial_api_cpp/02_whole_body_from_image_default.cpp +++ b/examples/tutorial_api_cpp/02_whole_body_from_image_default.cpp @@ -98,7 +98,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/03_keypoints_from_image.cpp b/examples/tutorial_api_cpp/03_keypoints_from_image.cpp index 6ad50103..940d12fe 100644 --- a/examples/tutorial_api_cpp/03_keypoints_from_image.cpp +++ b/examples/tutorial_api_cpp/03_keypoints_from_image.cpp @@ -182,7 +182,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/04_keypoints_from_images.cpp b/examples/tutorial_api_cpp/04_keypoints_from_images.cpp index 5630876d..ab8f3800 100644 --- a/examples/tutorial_api_cpp/04_keypoints_from_images.cpp +++ b/examples/tutorial_api_cpp/04_keypoints_from_images.cpp @@ -197,7 +197,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/05_keypoints_from_images_multi_gpu.cpp b/examples/tutorial_api_cpp/05_keypoints_from_images_multi_gpu.cpp index afa38c8c..0d3295b0 100644 --- a/examples/tutorial_api_cpp/05_keypoints_from_images_multi_gpu.cpp +++ b/examples/tutorial_api_cpp/05_keypoints_from_images_multi_gpu.cpp @@ -281,7 +281,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/06_face_from_image.cpp b/examples/tutorial_api_cpp/06_face_from_image.cpp index 362b798b..a1db25ed 100644 --- a/examples/tutorial_api_cpp/06_face_from_image.cpp +++ b/examples/tutorial_api_cpp/06_face_from_image.cpp @@ -210,7 +210,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/07_hand_from_image.cpp b/examples/tutorial_api_cpp/07_hand_from_image.cpp index 5d16f141..791fe065 100644 --- a/examples/tutorial_api_cpp/07_hand_from_image.cpp +++ b/examples/tutorial_api_cpp/07_hand_from_image.cpp @@ -219,7 +219,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/08_heatmaps_from_image.cpp b/examples/tutorial_api_cpp/08_heatmaps_from_image.cpp index 76b67207..9374e411 100644 --- a/examples/tutorial_api_cpp/08_heatmaps_from_image.cpp +++ b/examples/tutorial_api_cpp/08_heatmaps_from_image.cpp @@ -230,7 +230,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/09_keypoints_from_heatmaps.cpp b/examples/tutorial_api_cpp/09_keypoints_from_heatmaps.cpp index 07eccb0a..2220b32e 100644 --- a/examples/tutorial_api_cpp/09_keypoints_from_heatmaps.cpp +++ b/examples/tutorial_api_cpp/09_keypoints_from_heatmaps.cpp @@ -235,7 +235,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/10_asynchronous_custom_input.cpp b/examples/tutorial_api_cpp/10_asynchronous_custom_input.cpp index a64e5412..c44d0260 100644 --- a/examples/tutorial_api_cpp/10_asynchronous_custom_input.cpp +++ b/examples/tutorial_api_cpp/10_asynchronous_custom_input.cpp @@ -205,7 +205,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/11_asynchronous_custom_output.cpp b/examples/tutorial_api_cpp/11_asynchronous_custom_output.cpp index 9d35f393..944b45c3 100644 --- a/examples/tutorial_api_cpp/11_asynchronous_custom_output.cpp +++ b/examples/tutorial_api_cpp/11_asynchronous_custom_output.cpp @@ -233,7 +233,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/12_asynchronous_custom_input_output_and_datum.cpp b/examples/tutorial_api_cpp/12_asynchronous_custom_input_output_and_datum.cpp index e7bd9254..cbc167ee 100644 --- a/examples/tutorial_api_cpp/12_asynchronous_custom_input_output_and_datum.cpp +++ b/examples/tutorial_api_cpp/12_asynchronous_custom_input_output_and_datum.cpp @@ -308,7 +308,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/13_synchronous_custom_input.cpp b/examples/tutorial_api_cpp/13_synchronous_custom_input.cpp index 95ae0629..7eb99eec 100644 --- a/examples/tutorial_api_cpp/13_synchronous_custom_input.cpp +++ b/examples/tutorial_api_cpp/13_synchronous_custom_input.cpp @@ -200,7 +200,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/14_synchronous_custom_preprocessing.cpp b/examples/tutorial_api_cpp/14_synchronous_custom_preprocessing.cpp index f86d7fe3..750e0b6c 100644 --- a/examples/tutorial_api_cpp/14_synchronous_custom_preprocessing.cpp +++ b/examples/tutorial_api_cpp/14_synchronous_custom_preprocessing.cpp @@ -170,7 +170,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/15_synchronous_custom_postprocessing.cpp b/examples/tutorial_api_cpp/15_synchronous_custom_postprocessing.cpp index 814f8a1a..b1cc182e 100644 --- a/examples/tutorial_api_cpp/15_synchronous_custom_postprocessing.cpp +++ b/examples/tutorial_api_cpp/15_synchronous_custom_postprocessing.cpp @@ -171,7 +171,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/16_synchronous_custom_output.cpp b/examples/tutorial_api_cpp/16_synchronous_custom_output.cpp index 0c88fdeb..65881d99 100644 --- a/examples/tutorial_api_cpp/16_synchronous_custom_output.cpp +++ b/examples/tutorial_api_cpp/16_synchronous_custom_output.cpp @@ -224,7 +224,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/examples/tutorial_api_cpp/17_synchronous_custom_all_and_datum.cpp b/examples/tutorial_api_cpp/17_synchronous_custom_all_and_datum.cpp index 6fedf3dc..0e25f950 100644 --- a/examples/tutorial_api_cpp/17_synchronous_custom_all_and_datum.cpp +++ b/examples/tutorial_api_cpp/17_synchronous_custom_all_and_datum.cpp @@ -337,7 +337,7 @@ int tutorialApiCpp() // Return return 0; } - catch (const std::exception& e) + catch (const std::exception&) { return -1; } diff --git a/src/openpose/core/array.cpp b/src/openpose/core/array.cpp index 3daed4e1..e7cf578c 100644 --- a/src/openpose/core/array.cpp +++ b/src/openpose/core/array.cpp @@ -174,7 +174,7 @@ namespace op // Allocate memory reset(sizes); // Copy desired index - const auto arrayArea = array.getVolume(1); + const auto arrayArea = (int)array.getVolume(1); const auto keypointsIndex = index*arrayArea; std::copy(&array[keypointsIndex], &array[keypointsIndex]+arrayArea, pData); } diff --git a/src/openpose/core/keepTopNPeople.cpp b/src/openpose/core/keepTopNPeople.cpp index 78e043ba..7598c756 100644 --- a/src/openpose/core/keepTopNPeople.cpp +++ b/src/openpose/core/keepTopNPeople.cpp @@ -52,7 +52,7 @@ namespace op // Naively, we could accidentally keep the first 2x 0.5 and remove the 1.0 threshold. // Our method keeps the first 0.5 and 1.0. Array topPeopleArray({mNumberPeopleMax, peopleArray.getSize(1), peopleArray.getSize(2)}); - const auto personArea = peopleArray.getVolume(1, 2); + const auto personArea = (int)peopleArray.getVolume(1, 2); auto assignedPeopleOnThreshold = 0; auto nextPersonIndex = 0; const auto numberPeopleOnThresholdToBeAdded = mNumberPeopleMax - numberPeopleAboveThreshold; diff --git a/src/openpose/filestream/cocoJsonSaver.cpp b/src/openpose/filestream/cocoJsonSaver.cpp index 24a3b49e..b64c9726 100644 --- a/src/openpose/filestream/cocoJsonSaver.cpp +++ b/src/openpose/filestream/cocoJsonSaver.cpp @@ -10,7 +10,7 @@ namespace op { try { - return getLastNumber(imageName); + return (int)getLastNumber(imageName); } catch (const std::exception& e) { diff --git a/src/openpose/filestream/videoSaver.cpp b/src/openpose/filestream/videoSaver.cpp index 1ee26dca..62eb2c5e 100644 --- a/src/openpose/filestream/videoSaver.cpp +++ b/src/openpose/filestream/videoSaver.cpp @@ -121,17 +121,17 @@ namespace op + upImpl->mVideoSaverPath; log("Creating MP4 video out of JPG images by running:\n" + imageToVideoCommand + "\n", op::Priority::High); - auto codeAnswer = system(imageToVideoCommand.c_str()); + auto codeAnswerVideo = system(imageToVideoCommand.c_str()); // Remove temporary images - if (codeAnswer == 0) + if (codeAnswerVideo == 0) { - codeAnswer = system(("rm -rf " + upImpl->mTempImageFolder).c_str()); + codeAnswerVideo = system(("rm -rf " + upImpl->mTempImageFolder).c_str()); log("Video saved and temporary image folder removed.", op::Priority::High); } // Sanity check - if (codeAnswer != 0) + if (codeAnswerVideo != 0) log("\nVideo " + upImpl->mVideoSaverPath + " could not be saved (exit code: " - + std::to_string(codeAnswer) + "). Make sure you can manually run the following command" + + std::to_string(codeAnswerVideo) + "). Make sure you can manually run the following command" " (with no errors) from the terminal:\n" + imageToVideoCommand, op::Priority::High); // Video (no sound) --> Video (with sound) if (!upImpl->mAddAudioFromThisVideo.empty()) @@ -140,14 +140,14 @@ namespace op const auto audioCommand = "ffmpeg -y -i " + upImpl->mVideoSaverPath + " -i " + upImpl->mAddAudioFromThisVideo + " -codec copy -shortest " + tempOutput; log("Adding audio to video by running:\n" + audioCommand, op::Priority::High); - auto codeAnswer = system(audioCommand.c_str()); + auto codeAnswerAudio = system(audioCommand.c_str()); // Move temp output to real output - if (codeAnswer == 0) - codeAnswer = system(("mv " + tempOutput + " " + upImpl->mVideoSaverPath).c_str()); + if (codeAnswerAudio == 0) + codeAnswerAudio = system(("mv " + tempOutput + " " + upImpl->mVideoSaverPath).c_str()); // Sanity check - if (codeAnswer != 0) + if (codeAnswerAudio != 0) log("\nVideo " + upImpl->mVideoSaverPath + " could not be saved with audio (exit code: " - + std::to_string(codeAnswer) + "). Make sure you can manually run the following command" + + std::to_string(codeAnswerAudio) + "). Make sure you can manually run the following command" " (with no errors) from the terminal:\n" + audioCommand, op::Priority::High); } } diff --git a/src/openpose/net/resizeAndMergeBase.cu b/src/openpose/net/resizeAndMergeBase.cu index ac76f0ba..5fba3af4 100644 --- a/src/openpose/net/resizeAndMergeBase.cu +++ b/src/openpose/net/resizeAndMergeBase.cu @@ -55,7 +55,7 @@ namespace op template __global__ void resizeAndPadKernel( T* targetPtr, const T* const sourcePtr, const int widthSource, const int heightSource, const int widthTarget, - const int heightTarget, const float rescaleFactor) + const int heightTarget, const T rescaleFactor) { const auto x = (blockIdx.x * blockDim.x) + threadIdx.x; const auto y = (blockIdx.y * blockDim.y) + threadIdx.y; @@ -80,7 +80,7 @@ namespace op template __global__ void resizeAndPadKernel( T* targetPtr, const unsigned char* const sourcePtr, const int widthSource, const int heightSource, - const int widthTarget, const int heightTarget, const float rescaleFactor) + const int widthTarget, const int heightTarget, const T rescaleFactor) { const auto x = (blockIdx.x * blockDim.x) + threadIdx.x; const auto y = (blockIdx.y * blockDim.y) + threadIdx.y; @@ -290,10 +290,10 @@ namespace op const auto channels = targetSize[1]; const auto heightTarget = targetSize[2]; const auto widthTarget = targetSize[3]; - const dim3 threadsPerBlock{THREADS_PER_BLOCK_1D, THREADS_PER_BLOCK_1D}; - const dim3 numBlocks{ - getNumberCudaBlocks(widthTarget, threadsPerBlock.x), - getNumberCudaBlocks(heightTarget, threadsPerBlock.y)}; + // const dim3 threadsPerBlock{THREADS_PER_BLOCK_1D, THREADS_PER_BLOCK_1D}; + // const dim3 numBlocks{ + // getNumberCudaBlocks(widthTarget, threadsPerBlock.x), + // getNumberCudaBlocks(heightTarget, threadsPerBlock.y)}; const auto& sourceSize = sourceSizes[0]; const auto heightSource = sourceSize[2]; const auto widthSource = sourceSize[3]; diff --git a/src/openpose/pose/poseExtractorCaffe.cpp b/src/openpose/pose/poseExtractorCaffe.cpp index a7e3865b..dc3dff7b 100644 --- a/src/openpose/pose/poseExtractorCaffe.cpp +++ b/src/openpose/pose/poseExtractorCaffe.cpp @@ -439,20 +439,20 @@ namespace op mUpsamplingRatio); } // 2. Resize heat maps + merge different scales - const auto caffeNetOutputBlobs = arraySharedToPtr(caffeNetOutputBlob); - // const std::vector floatScaleRatios( + const auto caffeNetOutputBlobsNew = arraySharedToPtr(caffeNetOutputBlob); + // const std::vector floatScaleRatiosNew( // scaleInputToNetInputs.begin(), scaleInputToNetInputs.end()); - const std::vector floatScaleRatios{(float)scaleInputToNetInputs[0]}; - spResizeAndMergeCaffe->setScaleRatios(floatScaleRatios); + const std::vector floatScaleRatiosNew{(float)scaleInputToNetInputs[0]}; + spResizeAndMergeCaffe->setScaleRatios(floatScaleRatiosNew); spResizeAndMergeCaffe->Forward( - caffeNetOutputBlobs, {spHeatMapsBlob.get()}); + caffeNetOutputBlobsNew, {spHeatMapsBlob.get()}); // Get scale net to output (i.e., image input) const auto scaleRoiToOutput = float(mScaleNetToOutput / scaleNetToRoi); // 3. Get peaks by Non-Maximum Suppression const auto nmsThresholdRefined = 0.02f; spNmsCaffe->setThreshold(nmsThresholdRefined); - const auto nmsOffset = float(0.5/double(scaleRoiToOutput)); - spNmsCaffe->setOffset(Point{nmsOffset, nmsOffset}); + const auto nmsOffsetNew = float(0.5/double(scaleRoiToOutput)); + spNmsCaffe->setOffset(Point{nmsOffsetNew, nmsOffsetNew}); spNmsCaffe->Forward({spHeatMapsBlob.get()}, {spPeaksBlob.get()}); // Define poseKeypoints Array poseKeypoints; diff --git a/src/openpose/utilities/fileSystem.cpp b/src/openpose/utilities/fileSystem.cpp index c66bd6ff..0c3d941c 100644 --- a/src/openpose/utilities/fileSystem.cpp +++ b/src/openpose/utilities/fileSystem.cpp @@ -388,12 +388,12 @@ namespace op // Get files on directory with the desired extensions if (extensions == Extensions::Images) { - const std::vector extensions{ + const std::vector extensionNames{ // Completely supported by OpenCV "bmp", "dib", "pbm", "pgm", "ppm", "sr", "ras", // Most of them supported by OpenCV "jpg", "jpeg", "png"}; - return getFilesOnDirectory(directoryPath, extensions); + return getFilesOnDirectory(directoryPath, extensionNames); } // Unknown kind of extensions else diff --git a/src/openpose/utilities/keypoint.cpp b/src/openpose/utilities/keypoint.cpp index 196d9b1c..3e618276 100644 --- a/src/openpose/utilities/keypoint.cpp +++ b/src/openpose/utilities/keypoint.cpp @@ -434,7 +434,7 @@ namespace op error("Person index out of range.", __LINE__, __FUNCTION__, __FILE__); // Count keypoints auto nonZeroCounter = 0; - const auto baseIndex = person * keypoints.getVolume(1,2); + const auto baseIndex = person * (int)keypoints.getVolume(1,2); for (auto part = 0 ; part < keypoints.getSize(1) ; part++) if (keypoints[baseIndex + 3*part + 2] >= threshold) nonZeroCounter++; @@ -486,8 +486,8 @@ namespace op // Get total distance T totalDistance = 0; int nonZeroCounter = 0; - const auto baseIndexA = personA * keypointsA.getVolume(1,2); - const auto baseIndexB = personB * keypointsB.getVolume(1,2); + const auto baseIndexA = personA * (int)keypointsA.getVolume(1,2); + const auto baseIndexB = personB * (int)keypointsB.getVolume(1,2); for (auto part = 0 ; part < keypointsA.getSize(1) ; part++) { if (keypointsA[baseIndexA+3*part+2] >= threshold && keypointsB[baseIndexB+3*part+2] >= threshold)