diff --git a/html/wrapper_8hpp_source.html b/html/wrapper_8hpp_source.html index 4d6e1e90..06517727 100644 --- a/html/wrapper_8hpp_source.html +++ b/html/wrapper_8hpp_source.html @@ -1165,114 +1165,115 @@ $(document).ready(function(){initNavTree('wrapper_8hpp_source.html','');});
1199  }
1200  else
1201  {
-
1202  log("Multi-threading disabled, only 1 thread running. All GPUs have been disabled but the first"
-
1203  " one, which is defined by gpuNumberStart (in the demo, it is set with the `num_gpu_start`"
-
1204  " flag.");
-
1205  mThreadManager.add(mThreadId, spWPoses.at(0), queueIn, queueOut);
-
1206  }
-
1207  queueIn++;
-
1208  queueOut++;
-
1209  }
-
1210  // If custom user Worker and uses its own thread
-
1211  if (!mUserPostProcessingWs.empty() && mUserPostProcessingWsOnNewThread)
-
1212  {
-
1213  // Post processing workers
-
1214  if (!mPostProcessingWs.empty())
-
1215  {
-
1216  // Thread 2 or 3, queues 2 -> 3
-
1217  mThreadManager.add(mThreadId, mPostProcessingWs, queueIn++, queueOut++);
-
1218  threadIdPP();
-
1219  }
-
1220  // User processing workers
-
1221  // Thread 3 or 4, queues 3 -> 4
-
1222  mThreadManager.add(mThreadId, mUserPostProcessingWs, queueIn++, queueOut++);
-
1223  threadIdPP();
-
1224  // Output workers
-
1225  if (!mOutputWs.empty())
-
1226  {
-
1227  // Thread 4 or 5, queues 4 -> 5
-
1228  mThreadManager.add(mThreadId, mOutputWs, queueIn++, queueOut++);
-
1229  threadIdPP();
-
1230  }
-
1231  }
-
1232  // If custom user Worker in same thread or producer on same thread
-
1233  else
-
1234  {
-
1235  // Post processing workers + User post processing workers + Output workers
-
1236  auto workersAux = mergeWorkers(mPostProcessingWs, mUserPostProcessingWs);
-
1237  workersAux = mergeWorkers(workersAux, mOutputWs);
-
1238  if (!workersAux.empty())
-
1239  {
-
1240  // Thread 2 or 3, queues 2 -> 3
-
1241  mThreadManager.add(mThreadId, workersAux, queueIn++, queueOut++);
-
1242  threadIdPP();
-
1243  }
-
1244  }
-
1245  // User output worker
-
1246  // Thread Y, queues Q -> Q+1
-
1247  if (!mUserOutputWs.empty())
-
1248  {
-
1249  if (mUserOutputWsOnNewThread)
-
1250  {
-
1251  mThreadManager.add(mThreadId, mUserOutputWs, queueIn++, queueOut++);
-
1252  threadIdPP();
-
1253  }
-
1254  else
-
1255  mThreadManager.add(mThreadId-1, mUserOutputWs, queueIn++, queueOut++);
-
1256  }
-
1257  // OpenPose GUI
-
1258  if (spWGui != nullptr)
-
1259  {
-
1260  // Thread Y+1, queues Q+1 -> Q+2
-
1261  mThreadManager.add(mThreadId, spWGui, queueIn++, queueOut++);
-
1262  threadIdPP();
-
1263  }
-
1264  log("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
-
1265  }
-
1266  catch (const std::exception& e)
-
1267  {
-
1268  error(e.what(), __LINE__, __FUNCTION__, __FILE__);
-
1269  }
-
1270  }
-
1271 
-
1272  template<typename TDatums, typename TWorker, typename TQueue>
-
1273  unsigned long long Wrapper<TDatums, TWorker, TQueue>::threadIdPP()
-
1274  {
-
1275  try
-
1276  {
-
1277  if (mMultiThreadEnabled)
-
1278  mThreadId++;
-
1279  return mThreadId;
-
1280  }
-
1281  catch (const std::exception& e)
-
1282  {
-
1283  error(e.what(), __LINE__, __FUNCTION__, __FILE__);
-
1284  return 0ull;
-
1285  }
-
1286  }
-
1287 
-
1288  template<typename TDatums, typename TWorker, typename TQueue>
-
1289  std::vector<TWorker> Wrapper<TDatums, TWorker, TQueue>::mergeWorkers(const std::vector<TWorker>& workersA,
-
1290  const std::vector<TWorker>& workersB)
-
1291  {
-
1292  try
-
1293  {
-
1294  auto workersToReturn(workersA);
-
1295  for (auto& worker : workersB)
-
1296  workersToReturn.emplace_back(worker);
-
1297  return workersToReturn;
-
1298  }
-
1299  catch (const std::exception& e)
-
1300  {
-
1301  error(e.what(), __LINE__, __FUNCTION__, __FILE__);
-
1302  return std::vector<TWorker>{};
-
1303  }
-
1304  }
-
1305 
-
1306  extern template class Wrapper<DATUM_BASE_NO_PTR>;
-
1307 }
-
1308 
-
1309 #endif // OPENPOSE_WRAPPER_WRAPPER_HPP
+
1202  if (spWPoses.size() > 1)
+
1203  log("Multi-threading disabled, only 1 thread running. All GPUs have been disabled but the"
+
1204  " first one, which is defined by gpuNumberStart (e.g. in the OpenPose demo, it is set"
+
1205  " with the `num_gpu_start` flag).");
+
1206  mThreadManager.add(mThreadId, spWPoses.at(0), queueIn, queueOut);
+
1207  }
+
1208  queueIn++;
+
1209  queueOut++;
+
1210  }
+
1211  // If custom user Worker and uses its own thread
+
1212  if (!mUserPostProcessingWs.empty() && mUserPostProcessingWsOnNewThread)
+
1213  {
+
1214  // Post processing workers
+
1215  if (!mPostProcessingWs.empty())
+
1216  {
+
1217  // Thread 2 or 3, queues 2 -> 3
+
1218  mThreadManager.add(mThreadId, mPostProcessingWs, queueIn++, queueOut++);
+
1219  threadIdPP();
+
1220  }
+
1221  // User processing workers
+
1222  // Thread 3 or 4, queues 3 -> 4
+
1223  mThreadManager.add(mThreadId, mUserPostProcessingWs, queueIn++, queueOut++);
+
1224  threadIdPP();
+
1225  // Output workers
+
1226  if (!mOutputWs.empty())
+
1227  {
+
1228  // Thread 4 or 5, queues 4 -> 5
+
1229  mThreadManager.add(mThreadId, mOutputWs, queueIn++, queueOut++);
+
1230  threadIdPP();
+
1231  }
+
1232  }
+
1233  // If custom user Worker in same thread or producer on same thread
+
1234  else
+
1235  {
+
1236  // Post processing workers + User post processing workers + Output workers
+
1237  auto workersAux = mergeWorkers(mPostProcessingWs, mUserPostProcessingWs);
+
1238  workersAux = mergeWorkers(workersAux, mOutputWs);
+
1239  if (!workersAux.empty())
+
1240  {
+
1241  // Thread 2 or 3, queues 2 -> 3
+
1242  mThreadManager.add(mThreadId, workersAux, queueIn++, queueOut++);
+
1243  threadIdPP();
+
1244  }
+
1245  }
+
1246  // User output worker
+
1247  // Thread Y, queues Q -> Q+1
+
1248  if (!mUserOutputWs.empty())
+
1249  {
+
1250  if (mUserOutputWsOnNewThread)
+
1251  {
+
1252  mThreadManager.add(mThreadId, mUserOutputWs, queueIn++, queueOut++);
+
1253  threadIdPP();
+
1254  }
+
1255  else
+
1256  mThreadManager.add(mThreadId-1, mUserOutputWs, queueIn++, queueOut++);
+
1257  }
+
1258  // OpenPose GUI
+
1259  if (spWGui != nullptr)
+
1260  {
+
1261  // Thread Y+1, queues Q+1 -> Q+2
+
1262  mThreadManager.add(mThreadId, spWGui, queueIn++, queueOut++);
+
1263  threadIdPP();
+
1264  }
+
1265  log("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
+
1266  }
+
1267  catch (const std::exception& e)
+
1268  {
+
1269  error(e.what(), __LINE__, __FUNCTION__, __FILE__);
+
1270  }
+
1271  }
+
1272 
+
1273  template<typename TDatums, typename TWorker, typename TQueue>
+
1274  unsigned long long Wrapper<TDatums, TWorker, TQueue>::threadIdPP()
+
1275  {
+
1276  try
+
1277  {
+
1278  if (mMultiThreadEnabled)
+
1279  mThreadId++;
+
1280  return mThreadId;
+
1281  }
+
1282  catch (const std::exception& e)
+
1283  {
+
1284  error(e.what(), __LINE__, __FUNCTION__, __FILE__);
+
1285  return 0ull;
+
1286  }
+
1287  }
+
1288 
+
1289  template<typename TDatums, typename TWorker, typename TQueue>
+
1290  std::vector<TWorker> Wrapper<TDatums, TWorker, TQueue>::mergeWorkers(const std::vector<TWorker>& workersA,
+
1291  const std::vector<TWorker>& workersB)
+
1292  {
+
1293  try
+
1294  {
+
1295  auto workersToReturn(workersA);
+
1296  for (auto& worker : workersB)
+
1297  workersToReturn.emplace_back(worker);
+
1298  return workersToReturn;
+
1299  }
+
1300  catch (const std::exception& e)
+
1301  {
+
1302  error(e.what(), __LINE__, __FUNCTION__, __FILE__);
+
1303  return std::vector<TWorker>{};
+
1304  }
+
1305  }
+
1306 
+
1307  extern template class Wrapper<DATUM_BASE_NO_PTR>;
+
1308 }
+
1309 
+
1310 #endif // OPENPOSE_WRAPPER_WRAPPER_HPP
op::WrapperStructPose::poseModel
PoseModel poseModel
Definition: wrapperStructPose.hpp:87
headers.hpp
op::WrapperStructPose::netInputSize
Point< int > netInputSize
Definition: wrapperStructPose.hpp:30
diff --git a/html/wrapper_struct_input_8hpp_source.html b/html/wrapper_struct_input_8hpp_source.html index a19645dc..925e0bb0 100644 --- a/html/wrapper_struct_input_8hpp_source.html +++ b/html/wrapper_struct_input_8hpp_source.html @@ -131,13 +131,14 @@ $(document).ready(function(){initNavTree('wrapper_struct_input_8hpp_source.html'
48 
52  bool framesRepeat;
53 
-
59  WrapperStructInput(const std::shared_ptr<Producer> producerSharedPtr = nullptr, const unsigned long long frameFirst = 0,
-
60  const unsigned long long frameLast = -1, const bool realTimeProcessing = false, const bool frameFlip = false,
-
61  const int frameRotate = 0, const bool framesRepeat = false);
-
62  };
-
63 }
-
64 
-
65 #endif // OPENPOSE_WRAPPER_WRAPPER_STRUCT_INPUT_HPP
+
59  WrapperStructInput(const std::shared_ptr<Producer> producerSharedPtr = nullptr,
+
60  const unsigned long long frameFirst = 0, const unsigned long long frameLast = -1,
+
61  const bool realTimeProcessing = false, const bool frameFlip = false,
+
62  const int frameRotate = 0, const bool framesRepeat = false);
+
63  };
+
64 }
+
65 
+
66 #endif // OPENPOSE_WRAPPER_WRAPPER_STRUCT_INPUT_HPP
op::WrapperStructInput::frameFlip
bool frameFlip
Definition: wrapperStructInput.hpp:41
op::WrapperStructInput::framesRepeat
bool framesRepeat
Definition: wrapperStructInput.hpp:52
common.hpp