Fboylu (#551)
* Syncing staging <> master branches (#476) * Removed submodules. * Add back submodules using https:// * simplified plotting functions * fixed most tests * fixed test * fixed unit test * small text edits to the 02 notebook * added fct description * tiny cleanup on notebook * Add pretrained keypoint model (#453) * Add pretrained keypoint model * Fix bugs in tests * Add 03 notebook in conftest.py * Minor revision * Reformat code using black * if folder exists, remove (#448) * Add mask annotation tool (#447) * Add mask annotation tool * Update mask annotation explanation and add converion scripts * Add screenshots of Labelbox annotation * Rearrange screenshots * Move convertion script into functions in data.py * Point out annotation conversion scripts clearly in notebook * Refine annotation conversion scripts * Fix bugs * Add tests for labelbox format conversion methods * Move r2p1d from contrib to scenarios. * Update .gitignore. * Add README.md * Remove the folder /scenario/action_recognition/data/samples; update notebook to use web url for sample data. * Move data split files to data/misc; update notebook accordingly. * Update data path. * Add keypoint detection with tuned model (#454) * Add keypoint detetion with tuned model * Add tests * Minor revision * Update tests * Fix bugs in tests * Use GPU device if available * Update tests * Fix bug: 'not idx' will be 'True' if 'idx=0' * Fix bugs * Move toy keypoint meta into notebook * Fix bugs * Fix bugs * Fix bugs in notebook * Add descriptions for keypoint meta data * Raise exception when RandomHorizontalFlip is used without specifying hflip_inds * Add NOTICE file. * Add keypoint detection model tuning with top and bottom keypoints (#456) * Add keypoint detection model tuning with top and bottom keypoints * Fix undefined unzip_url * Resolved undefined od_urls * Add annotation tool to scenarios. * Plot keypoints as round dots to make them noticeable (#458) * Plot keypoints as dots * Change variable naming * Resolve test machine failure (#460) This is due to the latest PyTorch (version 1.3) from conda is built on CUDA 10.1 while the version on the test machine is CUDA 10.0. * Remove unused imports in 02_mask_rcnn.ipynb (#463) * Remove unused imports in 02_mask_rcnn.ipynb * Add missing imports * Simplify binary_mask() (#464) * clean up of keypoint detection notebook * minor clean-up * remove conflict code (#471) * Update README.md (#472) * updated readmes * added images * updated readmes * added intro figure * modified new picture * update figure * Move to bare Windows GPU VMs and fix build issues (#475) * Updating AzureDevOps pipeline agent pool to use a barebones Windows GPU VM. * Added a AzureDevOps pipeline for windows. * Added a conda init step for powershell. * Adding conda to PATH as a separate step * Pinning pillow to 6.1 to fix issues listed in: https://github.com/python-pillow/Pillow/issues/4130 * chained powershell commands * Updated AzureDevOps yml file to use the inline powershell script syntax. * Moved to using inline commands + Invoke-Expression syntax * Adding indentation for chained commands. * Moving to the literal block style indicator for yaml for chained commands. * Using call activate instead of source activate when activating the conda environment through powershell. * Switching to script steps instead of using powershell steps for conda operations. * Fixed the numpy.float64 issue by moving to a fork with the upstream fixes for the issue. * Fixed the numpy.float64 issue in utils/cv/detection/plot.py Co-authored-by: PatrickBue <pabuehle@microsoft.com> Co-authored-by: Simon Zhao <43029286+simonzhaoms@users.noreply.github.com> Co-authored-by: Miguel González-Fierro <3491412+miguelgfierro@users.noreply.github.com> Co-authored-by: JS <jiata@microsoft.com> * fix to load from saved mask-rcnn model * fix to load from saved mask-rcnn model * fix to load from saved mask-rcnn model Co-authored-by: Young Park <youngpark@cs.stanford.edu> Co-authored-by: PatrickBue <pabuehle@microsoft.com> Co-authored-by: Simon Zhao <43029286+simonzhaoms@users.noreply.github.com> Co-authored-by: Miguel González-Fierro <3491412+miguelgfierro@users.noreply.github.com> Co-authored-by: JS <jiata@microsoft.com>
This commit is contained in:
Родитель
2a0a783114
Коммит
369b088930
|
@ -803,7 +803,7 @@ class DetectionLearner:
|
|||
self.labels = meta_data["labels"]
|
||||
|
||||
@classmethod
|
||||
def from_saved_model(cls, name: str, path: str) -> "DetectionLearner":
|
||||
def from_saved_model(cls, name: str, path: str, mask: bool = False) -> "DetectionLearner":
|
||||
""" Create an instance of the DetectionLearner from a saved model.
|
||||
|
||||
This function expects the format that is outputted in the `save`
|
||||
|
@ -812,6 +812,7 @@ class DetectionLearner:
|
|||
Args:
|
||||
name: the name of the model you wish to load
|
||||
path: the path to get your model from
|
||||
mask: if the model is an instance of maskrcnn
|
||||
|
||||
Returns:
|
||||
A DetectionLearner object that can inference.
|
||||
|
@ -827,9 +828,15 @@ class DetectionLearner:
|
|||
im_size = meta_data["im_size"]
|
||||
labels = meta_data["labels"]
|
||||
|
||||
model = get_pretrained_fasterrcnn(
|
||||
if mask:
|
||||
model = get_pretrained_maskrcnn(
|
||||
len(labels) + 1, min_size=im_size, max_size=im_size
|
||||
)
|
||||
)
|
||||
else:
|
||||
model = get_pretrained_fasterrcnn(
|
||||
len(labels) + 1, min_size=im_size, max_size=im_size
|
||||
)
|
||||
|
||||
detection_learner = DetectionLearner(model=model, labels=labels)
|
||||
detection_learner.load(name=name, path=path)
|
||||
return detection_learner
|
||||
|
|
Загрузка…
Ссылка в новой задаче