-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update readme and run_webcam bug fix
- Loading branch information
1 parent
9ffe788
commit 1a88688
Showing
13 changed files
with
92 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
''' | ||
File: coco_utils.py | ||
Project: MobilePose | ||
File Created: Saturday, 3rd March 2018 7:04:57 pm | ||
Project: MobilePose-PyTorch | ||
File Created: Thursday, 20th December 2018 6:11:07 pm | ||
Author: Yuliang Xiu ([email protected]) | ||
----- | ||
Last Modified: Thursday, 8th March 2018 3:02:15 pm | ||
Last Modified: Monday, 11th March 2019 12:51:27 am | ||
Modified By: Yuliang Xiu ([email protected]>) | ||
----- | ||
Copyright 2018 - 2018 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
Copyright 2018 - 2019 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
''' | ||
|
||
|
||
|
||
# define coco class | ||
import json | ||
import numpy as np | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
''' | ||
File: dataloader.py | ||
Project: MobilePose | ||
File Created: Thursday, 8th March 2018 3:00:27 pm | ||
Project: MobilePose-PyTorch | ||
File Created: Tuesday, 15th January 2019 6:26:25 pm | ||
Author: Yuliang Xiu ([email protected]) | ||
----- | ||
Last Modified: Thursday, 8th March 2018 3:00:39 pm | ||
Last Modified: Monday, 11th March 2019 12:51:19 am | ||
Modified By: Yuliang Xiu ([email protected]>) | ||
----- | ||
Copyright 2018 - 2018 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
Copyright 2018 - 2019 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
''' | ||
|
||
|
||
import csv | ||
import numpy as np | ||
import os | ||
|
@@ -162,14 +163,6 @@ def __call__(self, sample): | |
# guass_heatmap = sample['guass_heatmap'] | ||
h, w = image.shape[:2] | ||
|
||
# x_mean = np.mean(image[:,:,3]) | ||
# x_std = np.std(image[:,:,3]) | ||
# y_mean = np.mean(image[:,:,4]) | ||
# y_std = np.std(image[:,:,4]) | ||
|
||
# mean=np.array([0.485, 0.456, 0.406, x_mean, y_mean]) | ||
# std=np.array([0.229, 0.224, 0.225, x_std, y_std]) | ||
|
||
mean=np.array([0.485, 0.456, 0.406]) | ||
std=np.array([0.229, 0.224, 0.225]) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
''' | ||
File: dataset_factory.py | ||
Project: MobilePose-PyTorch | ||
File Created: Sunday, 10th March 2019 8:02:12 pm | ||
Author: Yuliang Xiu ([email protected]) | ||
----- | ||
Last Modified: Monday, 11th March 2019 12:51:11 am | ||
Modified By: Yuliang Xiu ([email protected]>) | ||
----- | ||
Copyright 2018 - 2019 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
''' | ||
|
||
|
||
from dataloader import Rescale, Wrap, PoseDataset, ToTensor, Augmentation, Expansion | ||
from torchvision import datasets, transforms, utils, models | ||
import os | ||
|
@@ -12,14 +25,7 @@ def get_transform(modeltype, input_size): | |
:param input_size: | ||
:return: | ||
""" | ||
# if "resnet" in modeltype: | ||
# return Rescale((input_size, input_size)) | ||
# elif "mobilenet" in modeltype: | ||
# return Wrap((input_size, input_size)) | ||
# else: | ||
# raise ValueError("modeltype is not wrong") | ||
return Rescale((input_size, input_size)) | ||
# return Wrap((input_size, input_size)) | ||
|
||
|
||
class DatasetFactory: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
''' | ||
File: estimator.py | ||
Project: MobilePose | ||
File Created: Thursday, 8th March 2018 3:02:01 pm | ||
Project: MobilePose-PyTorch | ||
File Created: Monday, 11th March 2019 12:50:16 am | ||
Author: Yuliang Xiu ([email protected]) | ||
----- | ||
Last Modified: Thursday, 8th March 2018 3:02:06 pm | ||
Last Modified: Monday, 11th March 2019 12:50:58 am | ||
Modified By: Yuliang Xiu ([email protected]>) | ||
----- | ||
Copyright 2018 - 2018 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
Copyright 2018 - 2019 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
''' | ||
|
||
|
||
import itertools | ||
import logging | ||
import math | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
# coding: utf-8 | ||
''' | ||
File: eval.py | ||
Project: MobilePose | ||
File Created: Thursday, 8th March 2018 1:54:07 pm | ||
Project: MobilePose-PyTorch | ||
File Created: Thursday, 7th March 2019 1:50:18 pm | ||
Author: Yuliang Xiu ([email protected]) | ||
----- | ||
Last Modified: Thursday, 8th March 2018 3:01:51 pm | ||
Last Modified: Monday, 11th March 2019 12:50:50 am | ||
Modified By: Yuliang Xiu ([email protected]>) | ||
----- | ||
Copyright 2018 - 2018 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
Copyright 2018 - 2019 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
''' | ||
|
||
|
||
import warnings | ||
warnings.filterwarnings('ignore') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
''' | ||
File: networks.py | ||
Project: MobilePose | ||
File Created: Thursday, 8th March 2018 2:59:28 pm | ||
File: network.py | ||
Project: MobilePose-PyTorch | ||
File Created: Thursday, 7th March 2019 6:33:57 pm | ||
Author: Yuliang Xiu ([email protected]) | ||
----- | ||
Last Modified: Thursday, 8th March 2018 3:01:29 pm | ||
Last Modified: Monday, 11th March 2019 12:50:40 am | ||
Modified By: Yuliang Xiu ([email protected]>) | ||
----- | ||
Copyright 2018 - 2018 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
Copyright 2018 - 2019 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
''' | ||
|
||
|
||
|
||
from networks import * | ||
from networks.senet import se_resnet | ||
import torch.nn as nn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
numpy==1.14.5 | ||
matplotlib==3.0.2 | ||
scipy==1.1.0 | ||
Cython==0.29.2 | ||
dsntnn==0.4.0a0 | ||
torch==1.0.0 | ||
alog==0.9.13 | ||
tqdm==4.19.9 | ||
imgaug==0.2.7 | ||
torch==1.0.0 | ||
scipy==1.1.0 | ||
scikit_image==0.13.1 | ||
opencv_python==3.4.2.17 | ||
tqdm==4.19.9 | ||
numpy==1.14.5 | ||
torchvision==0.2.1 | ||
Cython==0.29.2 | ||
dsntnn==0.4.0a0 | ||
imgaug==0.2.7 | ||
matplotlib==3.0.2 | ||
Pillow==5.4.1 | ||
scripts==2.0 | ||
skimage==0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
''' | ||
File: run_webcam.py | ||
Project: MobilePose | ||
File Created: Thursday, 8th March 2018 2:19:39 pm | ||
Project: MobilePose-PyTorch | ||
File Created: Monday, 11th March 2019 12:47:30 am | ||
Author: Yuliang Xiu ([email protected]) | ||
----- | ||
Last Modified: Thursday, 8th March 2018 3:01:35 pm | ||
Last Modified: Monday, 11th March 2019 12:48:49 am | ||
Modified By: Yuliang Xiu ([email protected]>) | ||
----- | ||
Copyright 2018 - 2018 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
Copyright 2018 - 2019 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
''' | ||
|
||
import argparse | ||
|
@@ -48,7 +48,7 @@ | |
# initial the camera | ||
cam = cv2.VideoCapture(args.camera) | ||
|
||
# ret_val, image = cam.read() | ||
ret_val, image = cam.read() | ||
image = crop_camera(image) | ||
|
||
while True: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# coding: utf-8 | ||
|
||
''' | ||
File: training.py | ||
Project: MobilePose | ||
File Created: Thursday, 8th March 2018 2:50:11 pm | ||
Project: MobilePose-PyTorch | ||
File Created: Friday, 8th March 2019 6:53:13 pm | ||
Author: Yuliang Xiu ([email protected]) | ||
----- | ||
Last Modified: Thursday, 8th March 2018 2:50:51 pm | ||
Last Modified: Monday, 11th March 2019 12:50:27 am | ||
Modified By: Yuliang Xiu ([email protected]>) | ||
----- | ||
Copyright 2018 - 2018 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
Copyright 2018 - 2019 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
''' | ||
|
||
|
||
# remove warning | ||
import warnings | ||
warnings.filterwarnings('ignore') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
''' | ||
File: joint_transforms.py | ||
Project: MobilePose-PyTorch | ||
File Created: Monday, 7th January 2019 1:25:58 pm | ||
Author: Yuliang Xiu ([email protected]) | ||
----- | ||
Last Modified: Monday, 11th March 2019 12:51:40 am | ||
Modified By: Yuliang Xiu ([email protected]>) | ||
----- | ||
Copyright 2018 - 2019 Shanghai Jiao Tong University, Machine Vision and Intelligence Group | ||
''' | ||
|
||
|
||
import math | ||
import numbers | ||
import random | ||
|