Skip to content

Commit

Permalink
Merge pull request #7 from derpda/patch-1
Browse files Browse the repository at this point in the history
Standard library header include fixes
  • Loading branch information
medalotte authored Jul 17, 2022
2 parents 0f78ed7 + 0d6d550 commit d032036
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 30 deletions.
13 changes: 8 additions & 5 deletions include/ByteTrack/BYTETracker.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#pragma once

#include "ByteTrack/STrack.h"
#include "ByteTrack/lapjv.h"
#include "ByteTrack/Object.h"

#include <cstddef>
#include <limits>
#include <map>
#include <memory>

#include <ByteTrack/STrack.h>
#include <ByteTrack/lapjv.h>
#include <ByteTrack/Object.h>
#include <vector>

namespace byte_track
{
Expand Down Expand Up @@ -53,7 +56,7 @@ class BYTETracker
std::vector<int> &rowsol,
std::vector<int> &colsol,
bool extend_cost = false,
float cost_limit = LONG_MAX,
float cost_limit = std::numeric_limits<float>::max(),
bool return_cost = true) const;

private:
Expand Down
4 changes: 2 additions & 2 deletions include/ByteTrack/KalmanFilter.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <Eigen/Dense>
#include "Eigen/Dense"

#include <ByteTrack/Rect.h>
#include "ByteTrack/Rect.h"

namespace byte_track
{
Expand Down
2 changes: 1 addition & 1 deletion include/ByteTrack/Object.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <ByteTrack/Rect.h>
#include "ByteTrack/Rect.h"

namespace byte_track
{
Expand Down
2 changes: 1 addition & 1 deletion include/ByteTrack/Rect.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <Eigen/Dense>
#include "Eigen/Dense"

namespace byte_track
{
Expand Down
6 changes: 4 additions & 2 deletions include/ByteTrack/STrack.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#pragma once

#include <ByteTrack/Rect.h>
#include <ByteTrack/KalmanFilter.h>
#include "ByteTrack/Rect.h"
#include "ByteTrack/KalmanFilter.h"

#include <cstddef>

namespace byte_track
{
Expand Down
6 changes: 1 addition & 5 deletions include/ByteTrack/lapjv.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#pragma once

#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <iostream>
#include <cstddef>

namespace byte_track
{
Expand Down
14 changes: 11 additions & 3 deletions src/BYTETracker.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#include <ByteTrack/BYTETracker.h>
#include "ByteTrack/BYTETracker.h"

#include <cstddef>
#include <limits>
#include <map>
#include <memory>
#include <stdexcept>
#include <utility>
#include <vector>

byte_track::BYTETracker::BYTETracker(const int& frame_rate,
const int& track_buffer,
Expand Down Expand Up @@ -450,14 +458,14 @@ double byte_track::BYTETracker::execLapjv(const std::vector<std::vector<float>>
}
}

if (extend_cost || cost_limit < LONG_MAX)
if (extend_cost || cost_limit < std::numeric_limits<float>::max())
{
n = n_rows + n_cols;
cost_c_extended.resize(n);
for (size_t i = 0; i < cost_c_extended.size(); i++)
cost_c_extended[i].resize(n);

if (cost_limit < LONG_MAX)
if (cost_limit < std::numeric_limits<float>::max())
{
for (size_t i = 0; i < cost_c_extended.size(); i++)
{
Expand Down
4 changes: 3 additions & 1 deletion src/KalmanFilter.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <ByteTrack/KalmanFilter.h>
#include "ByteTrack/KalmanFilter.h"

#include <cstddef>

byte_track::KalmanFilter::KalmanFilter(const float& std_weight_position,
const float& std_weight_velocity) :
Expand Down
2 changes: 1 addition & 1 deletion src/Object.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <ByteTrack/Object.h>
#include "ByteTrack/Object.h"

byte_track::Object::Object(const Rect<float> &_rect,
const int &_label,
Expand Down
4 changes: 3 additions & 1 deletion src/Rect.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <ByteTrack/Rect.h>
#include "ByteTrack/Rect.h"

#include <algorithm>

template <typename T>
byte_track::Rect<T>::Rect(const T &x, const T &y, const T &width, const T &height) :
Expand Down
4 changes: 3 additions & 1 deletion src/STrack.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <ByteTrack/STrack.h>
#include "ByteTrack/STrack.h"

#include <cstddef>

byte_track::STrack::STrack(const Rect<float>& rect, const float& score) :
kalman_filter_(),
Expand Down
6 changes: 5 additions & 1 deletion src/lapjv.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#include <ByteTrack/lapjv.h>
#include "ByteTrack/lapjv.h"

#include <cstddef>
#include <cstring>
#include <stdexcept>

#define LAPJV_CPP_NEW(x, t, n) if ((x = (t *)malloc(sizeof(t) * (n))) == 0) { return -1; }
#define LAPJV_CPP_FREE(x) if (x != 0) { free(x); x = 0; }
Expand Down
14 changes: 8 additions & 6 deletions test/test_BYTETracker.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#include <ByteTrack/BYTETracker.h>
#include "ByteTrack/BYTETracker.h"

#include <gtest/gtest.h>
#include "gtest/gtest.h"

#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/foreach.hpp>
#include <boost/optional.hpp>
#include "boost/property_tree/ptree.hpp"
#include "boost/property_tree/json_parser.hpp"
#include "boost/foreach.hpp"
#include "boost/optional.hpp"

#include <cstddef>

namespace
{
Expand Down

0 comments on commit d032036

Please sign in to comment.