Skip to content
Prev Previous commit
Next Next commit
Add help functionality
  • Loading branch information
ryan1288 committed Mar 3, 2024
commit cb6d08ed5db2df6db290cd47c5990f36e92e4416
6 changes: 6 additions & 0 deletions models/object_tracking_vittrack/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,17 @@ cv::Mat visualize(const cv::Mat& image, const cv::Rect& bbox, float score, bool

int main(int argc, char** argv) {
cv::CommandLineParser parser(argc, argv,
"{help h | | Print help message. }"
"{input i | |Set path to the input video. Omit for using default camera.}"
"{model_path |object_tracking_vittrack_2023sep.onnx |Set model path}"
"{backend_target bt |0 |Choose backend-target pair: 0 - OpenCV implementation + CPU, 1 - CUDA + GPU (CUDA), 2 - CUDA + GPU (CUDA FP16), 3 - TIM-VX + NPU, 4 - CANN + NPU}"
"{save s |false |Specify to save a file with results. Invalid in case of camera input.}"
"{vis v |false |Specify to open a new window to show results. Invalid in case of camera input.}");
if (parser.has("help"))
{
parser.printMessage();
return 0;
}

std::string input_path = parser.get<std::string>("input");
std::string model_path = parser.get<std::string>("model_path");
Expand Down
1 change: 0 additions & 1 deletion models/object_tracking_vittrack/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
parser.add_argument('--vis', '-v', action='store_true',
help='Usage: Specify to open a new window to show results. Invalid in case of camera input.')
args = parser.parse_args()

def visualize(image, bbox, score, isLocated, fps=None, box_color=(0, 255, 0),text_color=(0, 255, 0), fontScale = 1, fontSize = 1):
output = image.copy()
h, w, _ = output.shape
Expand Down