File size: 1,231 Bytes
1b697ad
 
80c8d1e
1d7a994
13e7579
f555b99
8969b51
 
c6a363b
1b697ad
 
17b95b1
 
08e02d1
1b697ad
08e02d1
1b697ad
 
8969b51
 
1b697ad
 
a911b9a
08e02d1
 
1b697ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
import gradio as gr
os.system("pip3 install cython_bbox gdown 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'")
os.system("pip3 install -v -e .")
os.system("gdown https://drive.google.com/uc?id=1P4mY0Yyd3PPTybgZkjMYhFri88nTmJX5")

def inference(image):
  os.system("python3 tools/demo_track.py image -f exps/example/mot/yolox_x_mix_det.py -c ./bytetrack_x_mot17.pth.tar --save_result --device 'cpu' --path "+image.name)
  return "out.jpg"
  

title = "Bytetrack"
description = "Gradio demo for ByteTrack: Multi-Object Tracking by Associating Every Detection Box. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2110.06864' target='_blank'> ByteTrack: Multi-Object Tracking by Associating Every Detection Box </a> | <a href='https://github.com/ifzhang/ByteTrack' target='_blank'>Github Repo</a></p>"

examples=[['paint.jpeg']]
gr.Interface(
    inference, 
    gr.inputs.Image(type="file"), 
    gr.outputs.Image(type="file"),
    title=title,
    description=description,
    article=article,
    enable_queue=True,
    examples=examples
    ).launch(debug=True)