xmrt commited on
Commit
d94dadb
1 Parent(s): fd31e7c
Files changed (3) hide show
  1. Dockerfile +2 -1
  2. README.md +1 -1
  3. main.py +16 -10
Dockerfile CHANGED
@@ -7,7 +7,8 @@ COPY ./requirements.txt /code/requirements.txt
7
  #RUN pip install torch==1.9.1 torchvision==0.10.1 -f https://download.pytorch.org/whl/torch_stable.ht -extra-index-url https://download.pytorch.org/whl/cu111
8
  #https://download.pytorch.org/whl/torch_stable.ht
9
 
10
- RUN pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu113
 
11
  RUN pip install --no-cache-dir --upgrade -U openmim
12
  RUN mim install --no-cache-dir --upgrade mmengine
13
  RUN mim install "mmcv>=2.0.1"
 
7
  #RUN pip install torch==1.9.1 torchvision==0.10.1 -f https://download.pytorch.org/whl/torch_stable.ht -extra-index-url https://download.pytorch.org/whl/cu111
8
  #https://download.pytorch.org/whl/torch_stable.ht
9
 
10
+ RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cu117
11
+ # --extra-index-url https://download.pytorch.org/whl/cu113
12
  RUN pip install --no-cache-dir --upgrade -U openmim
13
  RUN mim install --no-cache-dir --upgrade mmengine
14
  RUN mim install "mmcv>=2.0.1"
README.md CHANGED
@@ -8,4 +8,4 @@ pinned: false
8
  python_version: 3.9
9
  ---
10
 
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
8
  python_version: 3.9
9
  ---
10
 
11
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
main.py CHANGED
@@ -29,7 +29,6 @@ human3d = MMPoseInferencer(pose3d="human3d")
29
  track_model = YOLO('yolov8n.pt') # Load an official Detect model
30
 
31
 
32
- # ultraltics
33
  if torch.cuda.is_available():
34
  device = "cuda"
35
  else:
@@ -192,7 +191,7 @@ def run_UI():
192
  submit_pose3d_file = gr.Button("Make 3d pose estimation")
193
  submit_hand_file = gr.Button("Make 2d hand estimation")
194
  submit_detect_file = gr.Button("Detect and track objects")
195
-
196
  with gr.Row():
197
  video_output1 = gr.PlayableVideo(height=512, label = "Estimate human 2d poses", show_label=True)
198
  video_output2 = gr.PlayableVideo(height=512, label = "Estimate human 3d poses", show_label=True)
@@ -230,16 +229,23 @@ def run_UI():
230
  show_label=False,
231
  )
232
 
233
- gr.Markdown("""Information about the models
234
- Pose models: `mmpose` is a library for human pose estimation that provides pre-trained models for 2D and 3D pose estimation.
235
- The 2D pose model is used for estimating the 2D coordinates of human body joints from an image or a video frame. The model uses a convolutional neural network (CNN) to predict the joint locations and their confidence scores.
236
- The 2D hand model is a specialized version of the 2D pose model that is designed for hand pose estimation. It uses a similar CNN architecture to the 2D pose model but is trained specifically for detecting the joints in the hand.
237
- The 3D pose model is used for estimating the 3D coordinates of human body joints from an image or a video frame. The model uses a combination of 2D pose estimation and depth estimation to infer the 3D joint locations.
238
- All of these models are pre-trained on large datasets and can be fine-tuned on custom datasets for specific applications.
239
 
240
- Ultralight detection and tracking model: The `track()` method in the Ultralight model is used for object tracking in videos. It takes a video file or a camera stream as input and returns the tracked objects in each frame. The method uses the COCO dataset classes for object detection and tracking. The COCO dataset contains 80 classes of objects such as person, car, bicycle, etc. See https://docs.ultralytics.com/datasets/detect/coco/ for all available classes. The `track()` method uses the COCO classes to detect and track the objects in the video frames.
241
- The tracked objects are represented as bounding boxes with labels indicating the class of the object. The Ultralight model is designed to be fast and efficient, making it suitable for real-time object tracking applications.""")
242
 
 
 
 
 
 
 
 
 
 
 
 
 
243
 
244
  # From file
245
  submit_pose_file.click(fn=pose2d,
 
29
  track_model = YOLO('yolov8n.pt') # Load an official Detect model
30
 
31
 
 
32
  if torch.cuda.is_available():
33
  device = "cuda"
34
  else:
 
191
  submit_pose3d_file = gr.Button("Make 3d pose estimation")
192
  submit_hand_file = gr.Button("Make 2d hand estimation")
193
  submit_detect_file = gr.Button("Detect and track objects")
194
+
195
  with gr.Row():
196
  video_output1 = gr.PlayableVideo(height=512, label = "Estimate human 2d poses", show_label=True)
197
  video_output2 = gr.PlayableVideo(height=512, label = "Estimate human 3d poses", show_label=True)
 
229
  show_label=False,
230
  )
231
 
232
+ gr.Markdown("""
233
+ \n # Information about the models
 
 
 
 
234
 
235
+ \n ## Pose models: All the pose estimation models comes from the library [MMpose](https://github.com/open-mmlab/mmpose). It is a library for human pose estimation that provides pre-trained models for 2D and 3D pose estimation.
 
236
 
237
+ \n ### The 2D pose model is used for estimating the 2D coordinates of human body joints from an image or a video frame. The model uses a convolutional neural network (CNN) to predict the joint locations and their confidence scores.
238
+
239
+ \n ### The 2D hand model is a specialized version of the 2D pose model that is designed for hand pose estimation. It uses a similar CNN architecture to the 2D pose model but is trained specifically for detecting the joints in the hand.
240
+
241
+ \n ### The 3D pose model is used for estimating the 3D coordinates of human body joints from an image or a video frame. The model uses a combination of 2D pose estimation and depth estimation to infer the 3D joint locations.
242
+
243
+ \n ### All of these models are pre-trained on large datasets and can be fine-tuned on custom datasets for specific applications.
244
+
245
+ \n ## Ultralight detection and tracking model: The `track()` method in the Ultralight model is used for object tracking in videos. It takes a video file or a camera stream as input and returns the tracked objects in each frame. The method uses the COCO dataset classes for object detection and tracking.
246
+
247
+ \n ### The COCO dataset contains 80 classes of objects such as person, car, bicycle, etc. See https://docs.ultralytics.com/datasets/detect/coco/ for all available classes. The `track()` method uses the COCO classes to detect and track the objects in the video frames.
248
+ The tracked objects are represented as bounding boxes with labels indicating the class of the object.""")
249
 
250
  # From file
251
  submit_pose_file.click(fn=pose2d,