Merge pull request #209 from microsoft/task_segmentation

Archai task: face segmentation
This commit is contained in:
piero2c 2023-04-11 09:59:30 -03:00 коммит произвёл GitHub
Родитель fed46daa82 28288861f1
Коммит 30d929c9c2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
110 изменённых файлов: 23307 добавлений и 170 удалений

4
.github/workflows/build-publish-docs.yml поставляемый
Просмотреть файл

@ -21,10 +21,10 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Sets up Conda with Python 3.7
- name: Sets up Conda with Python 3.8
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.7
python-version: 3.8
activate-environment: archai
- name: Installs the requirements
shell: bash -l {0}

4
.github/workflows/build-release-pypi.yml поставляемый
Просмотреть файл

@ -14,10 +14,10 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Sets up Python 3.7
- name: Sets up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
- name: Installs pypa/build
shell: bash -l {0}
run: |

4
.github/workflows/lint-run-unit-tests.yaml поставляемый
Просмотреть файл

@ -19,9 +19,9 @@ jobs:
name: Lints with `flake8` and run unit tests with `pytest`
strategy:
fail-fast: false
matrix:
matrix:
platform: [ windows-latest, ubuntu-latest ]
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10"]
runs-on: ${{ matrix.platform }}
steps:
- name: Pulls the repository

2
.github/workflows/run-notebook-tests.yml поставляемый
Просмотреть файл

@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10"]
steps:
- name: Pulls the repository
uses: actions/checkout@v3

7
.gitignore поставляемый
Просмотреть файл

@ -152,6 +152,7 @@ dmypy.json
# Pyre type checker
.pyre/
output/
# Azure notebooks
mlruns/
@ -159,3 +160,9 @@ dataroot/
temp_code/
mnist_test_run*/
logs/
output/
snpe-2.5.0.4052.zip
android-ndk-r25b-linux.zip
android-ndk-r25c-linux.zip
tasks/face_segmentation/snpe/docker/quantizer/quantizer.yaml
tasks/face_segmentation/.vscode/launch.json

9
.vscode/launch.json поставляемый
Просмотреть файл

@ -261,7 +261,14 @@
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
"console": "integratedTerminal",
"cwd": "D:\\git\\microsoft\\archai\\archai\\tasks\\face_segmentation",
"args":[
"--dataset_dir", "C:\\datasets\\FaceSynthetics",
"--output_dir", "d:\\temp\\face_segmentation",
"--search_config", "confs\\snp_search.yaml",
"--serial_training"
]
}
]
}

Просмотреть файл

@ -37,7 +37,7 @@ To install Archai via PyPI, the following command can be executed:
pip install archai
```
**Archai requires Python 3.7+ and PyTorch 1.7.0+ to function properly.**
**Archai requires Python 3.8+ and PyTorch 1.7.0+ to function properly.**
For further information, please consult the [installation guide](https://microsoft.github.io/archai/getting_started/installation.html).
@ -121,6 +121,7 @@ The algorithm will iterate through different network architectures, evaluate the
To demonstrate and showcase the capabilities/functionalities of Archai, a set of end-to-end tasks are provided:
* [Text Generation](https://github.com/microsoft/archai/blob/main/tasks/text_generation).
* [Face Segmentation](https://github.com/microsoft/archai/blob/main/tasks/face_segmentation).
## Documentation

Просмотреть файл

@ -82,7 +82,7 @@ class Config(UserDict):
self.config_filepath = config_filepath
def _load_from_file(self, filepath:Optional[str])->None:
def _load_from_file(self, filepath: Optional[str])->None:
if filepath:
filepath = os.path.expanduser(os.path.expandvars(filepath))
filepath = os.path.abspath(filepath)
@ -158,4 +158,3 @@ class Config(UserDict):
def get_inst()->'Config':
global _config
return _config

Просмотреть файл

@ -8,6 +8,7 @@ import logging
import datetime
import platform
import numpy as np
import re
from torch import Tensor
from azure.data.tables import TableServiceClient, UpdateMode, EntityProperty, EdmType
from azure.storage.blob import BlobClient, ContainerClient
@ -33,12 +34,13 @@ class ArchaiStore:
This also has a convenient command line interface provided below.
"""
def __init__(self, storage_account_name, storage_account_key, blob_container_name='models', status_table_name='status'):
def __init__(self, storage_account_name, storage_account_key, blob_container_name='models', table_name='status', partition_key='main'):
self.storage_account_key = storage_account_key
self.storage_account_name = storage_account_name
self.storage_connection_string = f'DefaultEndpointsProtocol=https;AccountName={storage_account_name};AccountKey={storage_account_key};EndpointSuffix=core.windows.net'
self.blob_container_name = blob_container_name
self.status_table_name = status_table_name
self.status_table_name = table_name
self.partition_key = partition_key
self.service = None
self.table_client = None
self.container_client = None
@ -115,7 +117,7 @@ class ArchaiStore:
table_client = self._get_table_client()
entities = []
query = "PartitionKey eq 'main'"
query = f"PartitionKey eq '{self.partition_key}'"
if status:
if not_equal:
query += f" and status ne '{status}'"
@ -125,7 +127,7 @@ class ArchaiStore:
try:
# find all properties (just use list_entities?)
for e in table_client.query_entities(query_filter=query):
entities += [self._wrap_numeric_types(e)]
entities += [self._unwrap_numeric_types(e)]
except Exception as e:
print(f"### error reading table: {e}")
@ -139,11 +141,11 @@ class ArchaiStore:
table_client = self._get_table_client()
try:
entity = table_client.get_entity(partition_key='main', row_key=name)
entity = table_client.get_entity(partition_key=self.partition_key, row_key=name)
entity = self._unwrap_numeric_types(entity)
except Exception:
entity = {
'PartitionKey': 'main',
'PartitionKey': self.partition_key,
'RowKey': name,
'name': name,
'status': 'new'
@ -154,7 +156,9 @@ class ArchaiStore:
e = {}
for k in entity.keys():
v = entity[k]
if isinstance(v, int):
if isinstance(v, bool):
e[k] = v
elif isinstance(v, int):
e[k] = EntityProperty(v, EdmType.INT64)
elif isinstance(v, float):
e[k] = float(v) # this is casting np.float to float.
@ -176,7 +180,7 @@ class ArchaiStore:
""" Find the given entity by name, and return it, or return None if the name is not found."""
table_client = self._get_table_client()
try:
entity = table_client.get_entity(partition_key='main', row_key=name)
entity = table_client.get_entity(partition_key=self.partition_key, row_key=name)
entity = self._unwrap_numeric_types(entity)
except Exception:
return None
@ -187,7 +191,7 @@ class ArchaiStore:
can pick up any changes that another process may have made. """
table_client = self._get_table_client()
try:
entity = table_client.get_entity(partition_key=e['PartitionKey'], row_key=e['RowKey'])
entity = table_client.get_entity(partition_key=self.partition_key, row_key=e['RowKey'])
entity = self._unwrap_numeric_types(entity)
except Exception:
return None
@ -356,20 +360,21 @@ class ArchaiStore:
print(f"Unlocking job {name} on node {node}")
self.merge_status_entity(e)
def reset(self, name):
def reset(self, name, except_list=[]):
""" This resets all properties on the given entity that are not primary keys,
'name' or 'status'. This will not touch a node that is locked by another. """
'name' or 'status' and are not in the given except_list.
This will not touch a node that is locked by another computer. """
e = self.get_existing_status(name)
if not e:
print(f"Entity {name} not found")
else:
self._reset(e)
self._reset(e, except_list)
def _reset(self, e):
def _reset(self, e, except_list=[]):
if self.is_locked_by_other(e):
node = self.get_lock(e)
print(f"Skipping {e['RowKey']} as it is locked by {node}")
elif self._reset_metrics(e):
elif self._reset_metrics(e, except_list):
e['status'] = 'reset'
print(f"Resetting entity {e['RowKey']}")
self.update_status_entity(e)
@ -379,11 +384,11 @@ class ArchaiStore:
for e in self.get_all_status_entities():
self._reset(e)
def _reset_metrics(self, entity):
def _reset_metrics(self, entity, except_list=[]):
# now clear all data to force a full re-run of everything.
modified = False
for key in list(entity.keys()):
if key != 'PartitionKey' and key != 'RowKey' and key != 'name' and key != 'status' and key != 'node':
if key != 'PartitionKey' and key != 'RowKey' and key != 'name' and key != 'status' and key != 'node' and key not in except_list:
del entity[key]
modified = True
return modified
@ -458,22 +463,25 @@ class ArchaiStore:
def download(self, name, folder, specific_file=None):
""" Download files from the given folder name from our associated blob container
and return a list of the local paths to all downloaded files. If an optional specific_file is
given then it tries to find and download that file only. Returns a list of local files created. """
given then it tries to find and download that file only. Returns a list of local files created.
The specific_file can be a regular expression like '*.onnx'. """
container = self._get_container_client(self.blob_container_name)
if not container.exists():
return (False, None)
return []
if not os.path.isdir(folder):
os.makedirs(folder)
local_file = None
prefix = f'{name}/'
downloaded = []
if specific_file:
specific_file_re = re.compile(specific_file)
for blob in container.list_blobs(name_starts_with=prefix):
file_name = blob.name[len(prefix):]
download = False
if specific_file:
if specific_file != file_name:
if not specific_file_re.match(file_name):
continue
else:
download = True
@ -498,8 +506,6 @@ class ArchaiStore:
downloaded += [local_file]
except Exception as e:
print(f"### Error downloading blob '{blob}' to local file: {e}")
if specific_file:
break
return downloaded
@ -513,6 +519,11 @@ class ArchaiStore:
continue
container.delete_blob(blob)
def list_blobs(self, prefix=None):
""" List all the blobs associated with the given prefix. """
container = self._get_container_client(self.blob_container_name)
return [blob.name for blob in container.list_blobs(name_starts_with=prefix)]
def print_entities(self, entities, columns=None):
keys = []
for e in entities:
@ -601,11 +612,10 @@ def download(con_str, args):
friendly_names = [friendly_name]
specific_file = args.file
all_files = False if specific_file else True
for friendly_name in friendly_names:
found, model, file = store.download(friendly_name, friendly_name, specific_file, all_files)
if not found and specific_file:
downloaded = store.download(friendly_name, friendly_name, specific_file)
if len(downloaded) == 0 and specific_file:
print(f"file {specific_file} not found")

Просмотреть файл

@ -0,0 +1,104 @@
from pathlib import Path
from typing import Callable, Optional, Tuple
from overrides import overrides
import torch
import torchvision.transforms.functional as F
from torchvision.io import read_image
from archai.api.dataset_provider import DatasetProvider
class FaceSyntheticsDataset(torch.utils.data.Dataset):
CLASSES = ['background', 'skin', 'nose', 'right_eye', 'left_eye', 'right_brow', 'left_brow',
'right_ear', 'left_ear', 'mouth_interior', 'top_lip', 'bottom_lip', 'neck', 'hair',
'beard', 'clothing', 'glasses', 'headwear', 'facewear']
def __init__(self, dataset_dir: str, img_size: Tuple[int, int] = (256, 256),
subset: str = 'train', val_size: int = 2000, ignore_index: int = 255,
mask_size: Optional[Tuple[int, int]] = None,
augmentation: Optional[Callable] = None):
"""Face Synthetics Dataset
Args:
dataset_dir (str): Dataset directory.
img_size (Tuple[int, int]): Image size (width, height). Defaults to (256, 256).
subset (str, optional): Subset ['train', 'test', 'validation']. Defaults to 'train'.
val_size (int, optional): Validation set size. Defaults to 2000.
mask_size (Optional[Tuple[int, int]], optional): Segmentation mask size (width, height). If `None`,
`img_size` is used. Defaults to None.
augmentation (Optional[Callable], optional): Augmentation function. Expects a callable object
with named arguments 'image' and 'mask' that returns a dictionary with 'image' and 'mask' as
keys. Defaults to None.
"""
dataset_dir = Path(dataset_dir)
assert dataset_dir.is_dir()
assert isinstance(img_size, tuple)
self.img_size = img_size
self.dataset_dir = dataset_dir
self.subset = subset
self.mask_size = mask_size
self.augmentation = augmentation
all_seg_files = [str(f) for f in sorted(self.dataset_dir.glob('*_seg.png'))]
train_subset, test_subset = all_seg_files[:90_000], all_seg_files[90_000:]
if subset == 'train':
self.seg_files = train_subset[:-val_size] if val_size > 0 else train_subset
elif subset == 'validation':
self.seg_files = train_subset[-val_size:] if val_size > 0 else None
elif subset == 'test':
self.seg_files = test_subset
self.img_files = [s.replace("_seg.png",".png") for s in self.seg_files]
self.ignore_index = ignore_index
def __len__(self):
return len(self.img_files)
def __getitem__(self, idx):
sample = {
'image': read_image(self.img_files[idx]),
'mask': read_image(self.seg_files[idx]).long()
}
if self.augmentation and self.subset == 'train':
sample = self.augmentation(**sample)
sample['image'] = sample['image']/255
mask_size = self.mask_size if self.mask_size else self.img_size
sample['mask'] = F.resize(
sample['mask'], mask_size[::-1],
interpolation=F.InterpolationMode.NEAREST
)
sample['image'] = F.resize(sample['image'], self.img_size[::-1])
return sample
class FaceSyntheticsDatasetProvider(DatasetProvider):
def __init__(self, dataset_dir: str):
self.dataset_dir = Path(dataset_dir)
assert self.dataset_dir.is_dir()
@overrides
def get_train_dataset(self, **kwargs) -> torch.utils.data.Dataset:
return FaceSyntheticsDataset(
self.dataset_dir, subset='train', **kwargs
)
@overrides
def get_test_dataset(self, **kwargs) -> torch.utils.data.Dataset:
return FaceSyntheticsDataset(
self.dataset_dir, subset='train', **kwargs
)
@overrides
def get_val_dataset(self, **kwargs) -> torch.utils.data.Dataset:
return FaceSyntheticsDataset(
self.dataset_dir, subset='validation', **kwargs
)

Просмотреть файл

@ -1,29 +1,19 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import datetime
import logging
import platform
import time
import uuid
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any, Dict, List, Optional, Tuple, Union
import torch
from azure.core.exceptions import ResourceNotFoundError
from azure.data.tables import TableServiceClient, UpdateMode
from azure.storage.blob import BlobServiceClient
from overrides import overrides
from archai.discrete_search.api.archai_model import ArchaiModel
from archai.discrete_search.api.model_evaluator import AsyncModelEvaluator
def _get_utc_date() -> str:
current_date = datetime.datetime.now()
current_date = current_date.replace(tzinfo=datetime.timezone.utc)
return current_date.isoformat()
from archai.common.store import ArchaiStore
class RemoteAzureBenchmarkEvaluator(AsyncModelEvaluator):
@ -37,15 +27,13 @@ class RemoteAzureBenchmarkEvaluator(AsyncModelEvaluator):
def __init__(
self,
input_shape: Union[Tuple, List[Tuple]],
connection_string: str,
blob_container_name: str,
table_name: str,
store: ArchaiStore,
metric_key: str,
partition_key: str,
overwrite: Optional[bool] = True,
max_retries: Optional[int] = 5,
retry_interval: Optional[int] = 120,
onnx_export_kwargs: Optional[Dict[str, Any]] = None,
verbose: bool = False
) -> None:
"""Initialize the evaluator.
@ -60,159 +48,120 @@ class RemoteAzureBenchmarkEvaluator(AsyncModelEvaluator):
max_retries: Maximum number of retries in `fetch_all`.
retry_interval: Interval between each retry attempt.
onnx_export_kwargs: Dictionary containing key-value arguments for `torch.onnx.export`.
verbose: Whether to print debug messages.
"""
# TODO: Make this class more general / less pipeline-specific
self.store = store
input_shapes = [input_shape] if isinstance(input_shape, tuple) else input_shape
self.sample_input = tuple([torch.rand(*input_shape) for input_shape in input_shapes])
self.blob_container_name = blob_container_name
self.blob_service_client = BlobServiceClient.from_connection_string(connection_string)
self.table_name = table_name
self.table_service_client = TableServiceClient.from_connection_string(
connection_string, logging_enable=False, logging_level="ERROR"
)
# Changes the Azure logging level to ERROR to avoid unnecessary output
logger = logging.getLogger("azure.core.pipeline.policies.http_logging_policy")
logger.setLevel(logging.ERROR)
self.metric_key = metric_key
self.partition_key = partition_key
self.overwrite = overwrite
self.max_retries = max_retries
self.retry_interval = retry_interval
self.onnx_export_kwargs = onnx_export_kwargs or dict()
self.verbose = verbose
# Architecture list
self.archids = []
def __contains__(self, rowkey_id: str) -> bool:
try:
self._get_entity(rowkey_id)
except ResourceNotFoundError:
return False
return True
@property
def table_client(self) -> Any:
"""Return the table client."""
return self.table_service_client.create_table_if_not_exists(self.table_name)
def _upload_blob(self, src_path: str, dst_path: str) -> None:
"""Upload a file to Azure Blob storage.
Args:
src_path: Path to the source file.
dst_path: Path to the destination file.
"""
src_path = Path(src_path)
assert src_path.is_file(), f"{src_path} does not exist or is not a file"
blob_client = self.blob_service_client.get_blob_client(container=self.blob_container_name, blob=dst_path)
with open(src_path, "rb") as data:
blob_client.upload_blob(data, overwrite=self.overwrite)
def _get_entity(self, rowkey_id: str) -> Dict[str, Any]:
"""Return the entity with the given `rowkey_id`.
Args:
rowkey_id: Row key of the entity.
Returns:
Entity dictionary.
"""
return self.table_client.get_entity(partition_key=self.partition_key, row_key=rowkey_id)
def _update_entity(self, rowkey_id: str, entity_dict: Dict[str, Any]) -> Dict[str, Any]:
"""Update the entity with the given `rowkey_id`.
Args:
rowkey_id: Row key of the entity.
entity_dict: Dictionary containing the entity properties.
Returns:
Entity dictionary.
"""
entity = {"PartitionKey": self.partition_key, "RowKey": rowkey_id}
entity.update(entity_dict)
return self.table_client.upsert_entity(entity, mode=UpdateMode.REPLACE)
# Test connection string works
unknown_id = str(uuid.uuid4())
_ = self.store.get_existing_status(unknown_id)
_ = self.store.list_blobs(unknown_id)
@overrides
def send(self, arch: ArchaiModel, budget: Optional[float] = None) -> None:
archid = str(arch.archid)
# Checks if architecture was already benchmarked
if archid in self:
entity = self._get_entity(archid)
entity = self.store.get_existing_status(archid)
if entity is not None:
if entity["status"] == "complete":
if self.metric_key in entity:
if self.verbose:
value = entity[self.metric_key]
print(f"Entry for {archid} already exists with {self.metric_key} = {value}")
return
else:
# complete but missing the mean, so reset everything so we can try again below.
self.store.reset(archid, ['benchmark_only', 'model_date'])
else:
# job is still running, let it continue
if self.verbose:
print(f"Job for {archid} is running...")
self.archids.append(archid)
return
if self.metric_key in entity and entity[self.metric_key]:
self.archids.append(archid)
return
entity = self.store.get_status(archid) # this is a get or create operation.
entity["benchmark_only"] = 1
entity["model_date"] = self.store.get_utc_date()
entity["model_name"] = "model.onnx"
self.store.update_status_entity(entity) # must be an update, not a merge.
self.store.lock_entity(entity, "uploading")
try:
with TemporaryDirectory() as tmp_dir:
tmp_dir = Path(tmp_dir)
entity = {
"status": "uploading",
"name": archid,
"node": platform.node(),
"benchmark_only": 1,
"model_date": _get_utc_date(),
"model_name": "model.onnx",
}
# Uploads ONNX file to blob storage and updates the table entry
arch.arch.to("cpu")
file_name = str(tmp_dir / "model.onnx")
# Exports model to ONNX
torch.onnx.export(
arch.arch,
self.sample_input,
file_name,
input_names=[f"input_{i}" for i in range(len(self.sample_input))],
**self.onnx_export_kwargs,
)
with TemporaryDirectory() as tmp_dir:
tmp_dir = Path(tmp_dir)
self.store.upload_blob(archid, file_name, "model.onnx")
entity["status"] = "new"
except Exception as e:
entity["error"] = str(e)
finally:
self.store.unlock_entity(entity)
# Uploads ONNX file to blob storage and updates the table entry
arch.arch.to("cpu")
# Exports model to ONNX
torch.onnx.export(
arch.arch,
self.sample_input,
str(tmp_dir / "model.onnx"),
input_names=[f"input_{i}" for i in range(len(self.sample_input))],
**self.onnx_export_kwargs,
)
self._update_entity(archid, entity)
self._upload_blob(str(tmp_dir / "model.onnx"), f"{archid}/model.onnx")
# Updates model status
del entity["node"]
entity["status"] = "new"
self._update_entity(archid, entity)
self.archids.append(archid)
if self.verbose:
print(f"Sent {archid} to Remote Benchmark")
@overrides
def fetch_all(self) -> List[Union[float, None]]:
results = [None for _ in self.archids]
results = [None] * len(self.archids)
completed = [False] * len(self.archids)
for _ in range(self.max_retries):
for i, archid in enumerate(self.archids):
if archid in self:
entity = self._get_entity(archid)
if not completed[i]:
entity = self.store.get_existing_status(archid)
if entity is not None:
if self.metric_key in entity and entity[self.metric_key]:
results[i] = entity[self.metric_key]
if "error" in entity:
error = entity["error"]
print(f"Skipping architecture {archid} because of remote error: {error}")
completed[i] = True
elif entity["status"] == "complete":
completed[i] = True
if self.metric_key in entity and entity[self.metric_key]:
results[i] = entity[self.metric_key]
if all(r is not None for r in results):
if all(completed):
break
if self.verbose:
status_dict = {
"complete": sum(r is not None for r in results),
"total": len(results),
}
print(
f"Waiting for results. Current status: {status_dict}\n"
f"Archids: {[archid for archid, status in zip(self.archids, results) if status is None]}"
)
time.sleep(self.retry_interval)
# Resets state

Просмотреть файл

@ -23,6 +23,7 @@ dependencies = [
"hyperopt",
"ipykernel",
"jupyter",
"lightning>=2.0.0",
"matplotlib",
"mldesigner",
"mlflow",
@ -38,7 +39,7 @@ dependencies = [
"psutil",
"pydata-sphinx-theme==0.13.1",
"pytest",
"pytorch-lightning",
"pyunpack",
"pyyaml",
"ray>=1.0.0",
"scikit-learn",
@ -75,7 +76,7 @@ extras_require = {}
extras_require["cv"] = filter_dependencies(
"gorilla",
"opencv-python",
"pytorch-lightning",
"lightning",
"scikit-learn",
"torchvision",
)
@ -120,7 +121,7 @@ extras_require["aml"] = filter_dependencies(
"matplotlib",
"mldesigner",
"mlflow",
"pytorch-lightning",
"lightning",
"torchvision",
)

1
tasks/face_segmentation/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1 @@
!*.json

Просмотреть файл

@ -0,0 +1,125 @@
# Face Segmentation
The purpose of this example/tutorial is to demonstrate how to perform multi-objective NAS for image segmentation models
using Archai. This approach allows us to optimize the model's performance with respect to multiple objectives, such as
Intersection Over Union (IOU) and inference time for various deployment targets. Specifically, we will focus on
performing the search for both regular CPU targets and Qualcomm's Snapdragon processor, enabling us to optimize the
models for deployment on mobile devices as well.
## Dataset
We will use the [Face Synthetics dataset](https://github.com/microsoft/FaceSynthetics) for this example. The dataset
comprises 100,000 512x512 synthetic face images, each annotated with 19 per-pixel semantic segmentation labels. These
labels cover various aspects of the face, including background, skin, eyes, ears, nose, lips, clothing, and headwear.
![Face Synthetics](assets/face_synthetics.png)
## Search Space
The search space used for this example is based on the [Stacked HourglassNet
architecture](https://arxiv.org/abs/1603.06937). The search space consists in 3 different block types: `downsample`,
`upsample` and `skip`, with each block type containing one or more possible operations. Additionally, `downsample`
blocks also control the number of channels.
![HourglassNet search space](assets/search_space.png)
## Neural Architecture Search
To run a search job, use the following command
```shell
python3 search.py --dataset_dir [face_synthetics_dir] --output_dir [output_dir] --search_config [search_config_file]
```
Use `--search_config` to specify the search config file with the desired search settings. We provide two basic search
configurations based on the desired target (CPU or Snapdragon processor), `search.py` will use
[cpu_search.yaml](confs/cpu_search.yaml) if no search config file is passed.
* [cpu_search.yaml](confs/cpu_search.yaml)
* [snp_search.yaml](confs/snp_search.yaml)
Note: to use `snp_search.yaml` you will need to follow the [SNP setup instructions](snpe/readme.md).
By default, `search.py` will run multiple partial training jobs using Ray (2 jobs per GPU). To change the number of gpus
per job, set `--gpus_per_job`, or use the `--serial_training` flag to disable parallel training jobs altogether.
The pareto architecture files selected by the search algorithm can be found under `[output_dir]/pareto_models_iter_XX`.
A table with the partial training performance and other objectives can be found in the
`[output_dir]/search_state_XX.csv` file.
## Final Training
To fully train one of the selected architectures by the NAS algorithm use the following command
```shell
python3 train.py [path_to_final_architecture.json] --dataset_dir [face_synthetics_dir] --output_dir [output_dir] --epochs [n_epochs]
```
## NAS Results (CPU Target)
### Search
![pareto_evolution](assets/pareto_evolution.png)
The selected architectures for the search with the `cpu_search.yaml` config file can be found in the
[archs/cpu_target/](arch/cpu_target/) directory or in the table below.
### Final Training
The table below shows the final results after fully training the final pareto architectures for 30 epochs using the
[train.py](./train.py) script.
| Architecture | Search iteration | ONNX Latency (s) | Full training Validation mIOU |
|:------------------------------------------------------------------------------------------------|---------------------:|---------------------:|--------------------------------:|
| [d650d48bdc83e75ae6ace9f20c17caa65fb5048a](archs/cpu_target/d650d48bdc83e75ae6ace9f20c17caa65fb5048a.json) | 9 | 0.070 | 0.88 |
| [07d670b8f76d8b9ca1e39379798d8b0046695b6a](archs/cpu_target/07d670b8f76d8b9ca1e39379798d8b0046695b6a.json) | 6 | 0.035 | 0.87 |
| [0cf2105627cd8ef8b86bdafd4987714dc2519827](archs/cpu_target/0cf2105627cd8ef8b86bdafd4987714dc2519827.json) | 8 | 0.027 | 0.85 |
| [1531903d654ecc930a0659e31b42c3efe6fe6ef3](archs/cpu_target/1531903d654ecc930a0659e31b42c3efe6fe6ef3.json) | 6 | 0.022 | 0.85 |
| [f22f089ae8c618117f4869f20213b344189bab9a](archs/cpu_target/f22f089ae8c618117f4869f20213b344189bab9a.json) | 4 | 0.025 | 0.84 |
| [b049ce7b41268d956af5410a3e838a2992d29232](archs/cpu_target/b049ce7b41268d956af5410a3e838a2992d29232.json) | 4 | 0.026 | 0.84 |
| [31cc57fe423f06a0f4d6ba000fe1e3decd3a442c](archs/cpu_target/31cc57fe423f06a0f4d6ba000fe1e3decd3a442c.json) | 8 | 0.019 | 0.84 |
| [1f1a7d04c4925d17f0575418cc974327ab71a93a](archs/cpu_target/1f1a7d04c4925d17f0575418cc974327ab71a93a.json) | 8 | 0.015 | 0.83 |
| [0c74d6d48a3514be3e80a84593c5f6b3f656fb3c](archs/cpu_target/0c74d6d48a3514be3e80a84593c5f6b3f656fb3c.json) | 8 | 0.016 | 0.82 |
| [1ab34d5fb31ef986650b5b112cfa3eca104b8107](archs/cpu_target/1ab34d5fb31ef986650b5b112cfa3eca104b8107.json) | 8 | 0.018 | 0.82 |
| [e6b8640bd2b83212e3256907a2382ae9bb799b65](archs/cpu_target/e6b8640bd2b83212e3256907a2382ae9bb799b65.json) | 5 | 0.012 | 0.82 |
| [82419a2ad358a34c508444c86db261616cf45ec3](archs/cpu_target/82419a2ad358a34c508444c86db261616cf45ec3.json) | 3 | 0.011 | 0.81 |
| [15914e86631373b2d9c823873ba6a88a1dc548c7](archs/cpu_target/15914e86631373b2d9c823873ba6a88a1dc548c7.json) | 9 | 0.010 | 0.77 |
| [de9067fa95074057353c67f62036a5b395a2d6a2](archs/cpu_target/de9067fa95074057353c67f62036a5b395a2d6a2.json) | 8 | 0.009 | 0.76 |
| [be543f6a3d1eadc9a42496f0b40871d82d4931df](archs/cpu_target/be543f6a3d1eadc9a42496f0b40871d82d4931df.json) | 8 | 0.007 | 0.73 |
## NAS Results (Snapdragon Target)
### Search
![pareto_evolution](assets/snp_pareto_evolution.png)
The selected architectures for the search with the `snp_search.yaml` config file can be found in the
[archs/snp_target/](arch/snp_target/) directory or in the table below.
### Final Training
The table below shows the final results after fully training the final pareto architectures for 30 epochs using the
[train.py](./train.py) script.
| Architecture | Search iteration | SNP Quantized Latency (s) | Partial Training Val. IOU | Full training Validation mIOU |
|:-----------------------------------------------------------------------------------------------------------|--------------------:|-----------------------------:|-----------------------------:|------------------:|
| [b14a1f0a3d17ea0f62022c2cf61da032fd7c9971](archs/snp_target/b14a1f0a3d17ea0f62022c2cf61da032fd7c9971.json) | 5 | 0.007 | 0.769 | 0.88 |
| [946fb0e27ef6ab9659b128006697a1b5a90e674c](archs/snp_target/946fb0e27ef6ab9659b128006697a1b5a90e674c.json) | 13 | 0.007 | 0.768 | 0.87 |
| [69f28a4c45aef58a67e2e2e0ce2d087b60b03173](archs/snp_target/69f28a4c45aef58a67e2e2e0ce2d087b60b03173.json) | 12 | 0.008 | 0.783 | 0.87 |
| [7bd6a76ec04e9f85c27d69a48557f689b0af2037](archs/snp_target/7bd6a76ec04e9f85c27d69a48557f689b0af2037.json) | 5 | 0.006 | 0.761 | 0.87 |
| [fb5511d6bee3bf52abed1527850c829cc4293098](archs/snp_target/fb5511d6bee3bf52abed1527850c829cc4293098.json) | 7 | 0.005 | 0.758 | 0.86 |
| [4fca939c89bf725f9efa47606c640e302f8ae9cc](archs/snp_target/4fca939c89bf725f9efa47606c640e302f8ae9cc.json) | 10 | 0.004 | 0.752 | 0.86 |
| [0ef9945b08c953586848a8507bc5d057fab7278d](archs/snp_target/0ef9945b08c953586848a8507bc5d057fab7278d.json) | 14 | 0.004 | 0.749 | 0.85 |
| [81f407d6f62de129e917c6b4f58021143a5df050](archs/snp_target/81f407d6f62de129e917c6b4f58021143a5df050.json) | 7 | 0.003 | 0.703 | 0.84 |
| [d47fc530a155c9c182773fc918fc3f17ed27a9d5](archs/snp_target/d47fc530a155c9c182773fc918fc3f17ed27a9d5.json) | 13 | 0.003 | 0.712 | 0.84 |
| [2aa378e5fad84ecc2114f8855a2cd8b02658cbdc](archs/snp_target/2aa378e5fad84ecc2114f8855a2cd8b02658cbdc.json) | 14 | 0.003 | 0.709 | 0.84 |
| [a223144f3b12adf3144478e5060bd99ef2a64ae9](archs/snp_target/a223144f3b12adf3144478e5060bd99ef2a64ae9.json) | 13 | 0.003 | 0.693 | 0.83 |
| [115fc8c962797a6dfd9c3f24fd5ccb4b60df95df](archs/snp_target/115fc8c962797a6dfd9c3f24fd5ccb4b60df95df.json) | 10 | 0.003 | 0.682 | 0.83 |
| [206e6e499eca01389b46c46989588ff04a2f3a42](archs/snp_target/206e6e499eca01389b46c46989588ff04a2f3a42.json) | 14 | 0.003 | 0.688 | 0.83 |
| [230f1fe115fac89432f5bccad7a01c65e3bb2918](archs/snp_target/230f1fe115fac89432f5bccad7a01c65e3bb2918.json) | 10 | 0.003 | 0.666 | 0.82 |
| [78c76774f378e083c788e56e86978f6d1d9f267c](archs/snp_target/78c76774f378e083c788e56e86978f6d1d9f267c.json) | 10 | 0.003 | 0.659 | 0.82 |
| [604ee54bcc767722bbdd3a610246aadca5a32214](archs/snp_target/604ee54bcc767722bbdd3a610246aadca5a32214.json) | 11 | 0.003 | 0.657 | 0.82 |
| [c570e333fd94f2d514eb1955fafc9eeeb012e750](archs/snp_target/c570e333fd94f2d514eb1955fafc9eeeb012e750.json) | 9 | 0.003 | 0.636 | 0.80 |
| [4786c03a18be281ad2fed235c86a5fe952fb4b0a](archs/snp_target/4786c03a18be281ad2fed235c86a5fe952fb4b0a.json) | 9 | 0.002 | 0.562 | 0.79 |

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 32,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 0.8
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 0.8
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 0.8
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 0.8
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 0.8
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 4,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 0.8
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 0.8
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 0.8
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 0.8
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 0.8
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 0.8
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 24,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 4,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 0.8
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 0.8
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 48,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 0.8
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 4,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 0.8
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,462 @@
{
"stem_stride": 2,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 0.8
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 0.8
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 48,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 24,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 24,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 32,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 24,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 16,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 48,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 24,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 48,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 24,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.0
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 48,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 32,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.0
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 48,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 24,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.5
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 48,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.0
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.5
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 24,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.0
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv5x5"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 24,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 2.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 1.6
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.0
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.6
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}

Просмотреть файл

@ -0,0 +1,578 @@
{
"stem_stride": 2,
"base_ch": 48,
"hourglasses": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.2
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.6
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
},
"1": {
"downsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 5,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv7x7"
}
}
},
"ch_expansion_factor": 1.0
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 2.2
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv3x3"
}
}
},
"ch_expansion_factor": 2.2
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.2
},
"4": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 3,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv7x7"
},
"2": {
"op": "conv5x5"
},
"3": {
"op": "conv5x5"
}
}
},
"ch_expansion_factor": 1.0
}
}
},
"skip_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
}
}
}
}
}
},
"upsample_blocks": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv3x3"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"1": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 4,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv5x5"
},
"2": {
"op": "conv7x7"
},
"3": {
"op": "conv7x7"
}
}
}
},
"2": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 1,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv3x3"
}
}
}
},
"3": {
"layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 2,
"_configs": {
"0": {
"op": "conv5x5"
},
"1": {
"op": "conv3x3"
},
"2": {
"op": "conv3x3"
},
"3": {
"op": "conv7x7"
}
}
}
}
}
}
}
}
},
"post_upsample_layers": {
"_config_type": "config_list",
"_share_arch": false,
"_repeat_times": 0,
"_configs": {
"0": {
"op": "conv7x7"
},
"1": {
"op": "conv3x3"
}
}
}
}

Двоичные данные
tasks/face_segmentation/assets/face_synthetics.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 436 KiB

Двоичные данные
tasks/face_segmentation/assets/pareto_evolution.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 42 KiB

Двоичные данные
tasks/face_segmentation/assets/search_space.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 32 KiB

Двоичные данные
tasks/face_segmentation/assets/snp_pareto_evolution.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 42 KiB

Просмотреть файл

@ -0,0 +1,25 @@
import os
from archai.discrete_search.search_spaces.config import ArchConfig
from archai.discrete_search.evaluators import TorchNumParameters
from archai.discrete_search.api.archai_model import ArchaiModel
from search_space.hgnet import StackedHourglass, HgnetSegmentationSearchSpace
from archai.common.config import Config
constraint = (1e5, 5e7)
evaluator = TorchNumParameters()
search_config = Config('confs/cpu_search.yaml')['search']
ss_config = search_config['search_space']
search_space = HgnetSegmentationSearchSpace(seed=1680312796, **ss_config.get('params', {}))
targets = os.path.join('archs', 'snp_target')
for file in os.listdir(targets):
path = os.path.join(targets, file)
if os.path.isfile(path) and path.endswith(".json"):
config = ArchConfig.from_file(path)
model = StackedHourglass(config, **search_space.model_kwargs)
archid = os.path.splitext(file)[0]
m = ArchaiModel(model, archid, config)
num_params = evaluator.evaluate(m, None)
if num_params < constraint[0] or num_params > constraint[1]:
print(f"Model {file} has {num_params} parameters and is outside the valid range.")

Просмотреть файл

@ -0,0 +1,39 @@
search:
search_space:
name: hgnet
params:
num_classes: 18
img_size: [256, 256] # (w, h)
in_channels: 3
op_subset: ['conv3x3', 'conv5x5', 'conv7x7']
stem_strides: [2]
# Number of downsampling blocks (without counting stem conv)
num_blocks: 5
# Maximum number of layers in downsampling blocks
downsample_block_max_ops: 4
# Maximum number of layers in skip blocks
skip_block_max_ops: 2
# Maximum number of layers in upsampling blocks
upsample_block_max_ops: 4
# Maximum number of layers after the final upsampling layer
post_upsample_max_ops: 2
algorithm:
name: evolution_pareto
params:
num_iters: 20
init_num_models: 20
mutations_per_parent: 5
num_crossovers: 10
max_unseen_population: 50
num_random_mix: 5
target:
name: cpu

Просмотреть файл

@ -0,0 +1,47 @@
search:
search_space:
name: hgnet
params:
num_classes: 18
img_size: [256, 256] # (w, h)
in_channels: 3
op_subset: ['conv3x3', 'conv5x5', 'conv7x7']
stem_strides: [2]
# Number of downsampling blocks (without counting stem conv)
num_blocks: 5
# Maximum number of layers in downsampling blocks
downsample_block_max_ops: 4
# Maximum number of layers in skip blocks
skip_block_max_ops: 2
# Maximum number of layers in upsampling blocks
upsample_block_max_ops: 4
# Maximum number of layers after the final upsampling layer
post_upsample_max_ops: 2
algorithm:
name: evolution_pareto
params:
num_iters: 20
init_num_models: 20
mutations_per_parent: 5
num_crossovers: 6
max_unseen_population: 20
num_random_mix: 6
target:
name: snp
connection_str_env_var: MODEL_STORAGE_CONNECTION_STRING
blob_container_name: models
table_name: status
partition_key: main
max_retries: 15
retry_interval: 120
metric_key: mean
verbose: true

Просмотреть файл

@ -0,0 +1,60 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from pathlib import Path
import torch
import os
from argparse import ArgumentParser
from archai.discrete_search.search_spaces.config import ArchConfig
from search_space.hgnet import StackedHourglass
def export(checkpoint, model, onnx_file):
state_dict = checkpoint['state_dict']
# strip 'model.' prefix off the keys!
state_dict = dict({(k[6:], state_dict[k]) for k in state_dict})
model.load_state_dict(state_dict)
input_shapes = [(1, 3, 256, 256)]
rand_range = (0.0, 1.0)
export_kwargs = {'opset_version': 11}
rand_min, rand_max = rand_range
sample_inputs = tuple(
[
((rand_max - rand_min) * torch.rand(*input_shape) + rand_min).type("torch.FloatTensor")
for input_shape in input_shapes
]
)
torch.onnx.export(
model,
sample_inputs,
onnx_file,
input_names=[f"input_{i}" for i in range(len(sample_inputs))],
**export_kwargs,
)
print(f'Exported {onnx_file}')
def main():
parser = ArgumentParser(
"Converts the final_model.ckpt to final_model.onnx, writing the onnx model to the same folder."
)
parser.add_argument('arch', type=Path, help="Path to config.json file describing the model architecture")
parser.add_argument('--checkpoint', help="Path of the checkpoint to export")
args = parser.parse_args()
checkpoint = torch.load(args.checkpoint)
# get the directory name from args.checkpoint
output_path = os.path.dirname(os.path.realpath(args.checkpoint))
base_name = os.path.splitext(os.path.basename(args.checkpoint))[0]
onnx_file = os.path.join(output_path, f'{base_name}.onnx')
arch_config = ArchConfig.from_file(args.arch)
model = StackedHourglass(arch_config, num_classes=18)
export(checkpoint, model, onnx_file)
if __name__ == '__main__':
main()

Просмотреть файл

@ -0,0 +1,166 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import sys
import itertools
from pathlib import Path
from argparse import ArgumentParser
from typing import List, Optional
from archai.common.config import Config
from archai.common.store import ArchaiStore
from archai.datasets.cv.face_synthetics import FaceSyntheticsDatasetProvider
from archai.discrete_search.api import SearchObjectives
from archai.discrete_search.algos import (
MoBananasSearch, EvolutionParetoSearch, LocalSearch,
RandomSearch, RegularizedEvolutionSearch
)
from archai.discrete_search.evaluators import TorchNumParameters, AvgOnnxLatency, RayParallelEvaluator
from archai.discrete_search.evaluators.remote_azure_benchmark import RemoteAzureBenchmarkEvaluator
from search_space.hgnet import HgnetSegmentationSearchSpace
from training.partial_training_evaluator import PartialTrainingValIOU
AVAILABLE_ALGOS = {
'mo_bananas': MoBananasSearch,
'evolution_pareto': EvolutionParetoSearch,
'local_search': LocalSearch,
'random_search': RandomSearch,
'regularized_evolution': RegularizedEvolutionSearch
}
AVAILABLE_SEARCH_SPACES = {
'hgnet': HgnetSegmentationSearchSpace,
}
confs_path = Path(__file__).absolute().parent / 'confs'
def filter_extra_args(extra_args: List[str], prefix: str) -> List[str]:
return list(itertools.chain([
[arg, val]
for arg, val in zip(extra_args[::2], extra_args[1::2])
if arg.startswith(prefix)
]))
def main():
parser = ArgumentParser()
parser.add_argument('--dataset_dir', type=Path, help='Face Synthetics dataset directory.', required=True)
parser.add_argument('--output_dir', type=Path, help='Output directory.', required=True)
parser.add_argument('--search_config', type=Path, help='Search config file.', default=confs_path / 'cpu_search.yaml')
parser.add_argument('--serial_training', help='Search config file.', action='store_true')
parser.add_argument('--gpus_per_job', type=float, help='Number of GPUs used per job (if `serial_training` flag is disabled)',
default=0.5)
parser.add_argument('--partial_tr_epochs', type=float, help='Number of epochs to run partial training', default=1.0)
parser.add_argument('--seed', type=int, help='Random seed', default=42)
parser.add_argument('--max_parameters', type=float, help='Specify a maximum number of parameters in the model (default 50M or 5e7).', default=5e7)
args, extra_args = parser.parse_known_args()
# Filters extra args that have the prefix `search_space`
search_extra_args = filter_extra_args(extra_args, 'search.')
search_config = Config(str(args.search_config), search_extra_args)['search']
# Search space
ss_config = search_config['search_space']
search_space = AVAILABLE_SEARCH_SPACES[ss_config['name']](
seed=args.seed,
**ss_config.get('params', {}),
)
input_shape = (1, search_space.in_channels, *search_space.img_size[::-1])
# Search objectives
so = SearchObjectives()
target_config = search_config.get('target', {})
target_name = target_config.pop('name', 'cpu')
assert target_name in ['cpu', 'snp']
max_latency = 0.3 if target_name == 'cpu' else 0.185
# Adds a constraint on number of parameters so we don't sample models that are too large
so.add_constraint(
'Model Size (b)',
TorchNumParameters(),
constraint=(1e6, args.max_parameters)
)
# Adds a constrained objective on model latency so we don't pick models that are too slow.
so.add_objective(
'CPU ONNX Latency (s)',
AvgOnnxLatency(
input_shape=input_shape, export_kwargs={'opset_version': 11}
),
higher_is_better=False,
compute_intensive=False,
constraint=[0, max_latency]
)
if target_name == 'snp':
# Gets connection string from env variable
env_var_name = target_config.pop('connection_str_env_var')
con_str = os.getenv(env_var_name)
if not con_str:
print("Please set environment variable {env_var_name} containing the Azure storage account connection " +
"string for the Azure storage account you want to use to control this experiment.")
sys.exit(1)
blob_container_name = target_config.pop('blob_container_name', 'models')
table_name = target_config.pop('table_name', 'status')
partition_key = target_config.pop('partition_key', 'main')
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(con_str)
store = ArchaiStore(storage_account_name, storage_account_key, blob_container_name, table_name, partition_key)
evaluator = RemoteAzureBenchmarkEvaluator(
input_shape=input_shape,
store=store,
onnx_export_kwargs={'opset_version': 11},
**target_config
)
so.add_objective(
'SNP Quantized Latency (s)',
evaluator,
higher_is_better=False,
compute_intensive=True
)
# Dataset provider
dataset_provider = FaceSyntheticsDatasetProvider(args.dataset_dir)
partial_tr_obj = PartialTrainingValIOU(
dataset_provider,
tr_epochs=args.partial_tr_epochs,
output_dir=args.output_dir / 'partial_training_logs'
)
if not args.serial_training:
partial_tr_obj = RayParallelEvaluator(
partial_tr_obj, num_gpus=args.gpus_per_job,
max_calls=1
)
so.add_objective(
'Partial Training Val. IOU',
partial_tr_obj,
higher_is_better=True,
compute_intensive=True
)
# Search algorithm
algo_config = search_config['algorithm']
algo = AVAILABLE_ALGOS[algo_config['name']](
search_space, so,
output_dir=args.output_dir, seed=args.seed,
**algo_config.get('params', {}),
)
algo.search()
if __name__ == '__main__':
main()

Просмотреть файл

Просмотреть файл

@ -0,0 +1,224 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from functools import partial
from typing import Tuple, Optional, List
import torch
from torch import nn
from archai.discrete_search.search_spaces.config import (
ArchConfig, ArchParamTree, DiscreteChoice, ConfigSearchSpace, repeat_config
)
from .ops import ReluConv2d, Conv2dSamePadding, OPS
def hgnet_param_tree_factory(stem_strides: Tuple[int, ...] = (2, 4),
max_num_hourglass: int = 2,
share_hourglass_arch: bool = False,
base_channels: Tuple[int, ...] = (16, 24, 32, 48),
op_subset: Tuple[str, ...] = ('conv3x3', 'conv5x5', 'conv7x7'),
num_blocks: int = 4,
downsample_block_max_ops: int = 5,
post_upsample_max_ops: int = 3,
skip_block_max_ops: int = 3,
upsample_block_max_ops: int = 4):
assert num_blocks > 1, 'num_blocks must be greater than 1'
return ArchParamTree({
'stem_stride': DiscreteChoice(stem_strides),
'base_ch': DiscreteChoice(base_channels),
'hourglasses': repeat_config({
'downsample_blocks': repeat_config({
'layers': repeat_config({
'op': DiscreteChoice(op_subset)
}, repeat_times=range(1, downsample_block_max_ops + 1), share_arch=False),
'ch_expansion_factor': DiscreteChoice([1.0, 1.2, 1.5, 1.6, 2.0, 2.2]),
}, repeat_times=num_blocks),
'skip_blocks': repeat_config({
'layers': repeat_config({
'op': DiscreteChoice(op_subset)
}, repeat_times=range(0, skip_block_max_ops+1), share_arch=False),
}, repeat_times=num_blocks-1),
'upsample_blocks': repeat_config({
'layers': repeat_config({
'op': DiscreteChoice(op_subset)
}, repeat_times=range(1, upsample_block_max_ops+1), share_arch=False),
}, repeat_times=num_blocks-1),
}, repeat_times=range(1, max_num_hourglass+1), share_arch=share_hourglass_arch),
'post_upsample_layers': repeat_config({
'op': DiscreteChoice(op_subset)
}, repeat_times=range(0, post_upsample_max_ops+1), share_arch=False)
})
class Hourglass(nn.Module):
def __init__(self, arch_config: ArchConfig, base_channels: int):
super().__init__()
self.base_channels = base_channels
self.upsample = nn.UpsamplingBilinear2d(scale_factor=2)
self.chs = [self.base_channels]
# Calculates channels on each branch
for block_cfg in arch_config.pick('downsample_blocks'):
self.chs.append(
int(self.chs[-1] * block_cfg.pick('ch_expansion_factor'))
)
self.nb_blocks = len(self.chs) - 1
# Downsample blocks
self.down_blocks = nn.ModuleList()
for block_idx, block_cfg in enumerate(arch_config.pick('downsample_blocks')):
in_ch, out_ch = self.chs[block_idx], self.chs[block_idx + 1]
down_block = [
OPS[layer_cfg.pick('op')](
(in_ch if layer_idx == 0 else out_ch),
out_ch,
stride=(2 if (layer_idx == 0 and block_idx > 0) else 1)
)
for layer_idx, layer_cfg in enumerate(block_cfg.pick('layers'))
]
self.down_blocks.append(nn.Sequential(*down_block))
# Skip blocks
self.skip_blocks = nn.ModuleList()
for block_idx, block_cfg in enumerate(arch_config.pick('skip_blocks')):
out_ch = self.chs[block_idx + 1]
skip_block = [
OPS.get(layer_cfg.pick('op'))(out_ch, out_ch)
for layer_idx, layer_cfg in enumerate(block_cfg.pick('layers'))
]
self.skip_blocks.append(nn.Sequential(*skip_block))
# Upsample blocks
self.up_blocks = nn.ModuleList()
for block_idx, block_cfg in enumerate(arch_config.pick('upsample_blocks')):
in_ch, out_ch = self.chs[block_idx + 1], self.chs[block_idx + 2]
up_block = [
OPS.get(layer_cfg.pick('op'))(
(out_ch if layer_idx == 0 else in_ch), in_ch
)
for layer_idx, layer_cfg in enumerate(block_cfg.pick('layers'))
]
self.up_blocks.append(nn.Sequential(*up_block))
# Converts output to `base_channels`
self.final_conv = nn.Conv2d(self.chs[1], base_channels, kernel_size=1)
def forward(self, x: torch.FloatTensor) -> torch.FloatTensor:
skip_connections = [0 for _ in range(self.nb_blocks - 1)]
inp = x
for i in range(self.nb_blocks - 1):
out = self.down_blocks[i](inp)
skip_connections[i] = self.skip_blocks[i](out)
inp = out
# Last downsample branch
out = self.down_blocks[-1](inp)
for i in range(self.nb_blocks - 1)[::-1]:
out = skip_connections[i] + self.up_blocks[i](self.upsample(out))
return self.final_conv(out)
class StackedHourglass(nn.Module):
def __init__(self, arch_config: ArchConfig, num_classes: int, in_channels: int = 3):
super().__init__()
self.num_classes = num_classes
self.in_channels = in_channels
self.arch_config = arch_config
self.base_channels = arch_config.pick('base_ch')
# Classifier
self.classifier = nn.Conv2d(self.base_channels, num_classes, kernel_size=1)
# Stem convolution
self.stem_stride = arch_config.pick('stem_stride')
self.stem_conv = ReluConv2d(
in_channels=in_channels, out_channels=self.base_channels,
stride=self.stem_stride
)
self.final_upsample = nn.UpsamplingBilinear2d(scale_factor=self.stem_stride)
self.hgs = nn.Sequential(*[
Hourglass(hg_conf, self.base_channels)
for hg_conf in arch_config.pick('hourglasses')
])
self.post_upsample = nn.Sequential(*[
OPS[layer_cfg.pick('op')](self.base_channels, self.base_channels)
for layer_cfg in arch_config.pick('post_upsample_layers')
])
self.classifier = Conv2dSamePadding(self.base_channels, num_classes, kernel_size=1)
def forward(self, x: torch.Tensor) -> torch.Tensor:
out = self.stem_conv(x)
out = self.hgs(out)
out = self.post_upsample(self.final_upsample(out))
return self.classifier(out)
class HgnetSegmentationSearchSpace(ConfigSearchSpace):
def __init__(self,
num_classes: int,
img_size: Tuple[int, int],
in_channels: int = 3,
op_subset: Tuple[str, ...] = ('conv3x3', 'conv5x5', 'conv7x7'),
stem_strides: Tuple[int, ...] = (1, 2, 4),
num_blocks: int = 4,
downsample_block_max_ops: int = 4,
skip_block_max_ops: int = 2,
upsample_block_max_ops: int = 4,
post_upsample_max_ops: int = 3,
**ss_kwargs):
possible_downsample_factors = [
2**num_blocks * stem_stride for stem_stride in stem_strides
]
w, h = img_size
assert all(w % d_factor == 0 for d_factor in possible_downsample_factors), \
f'Image width must be divisible by all possible downsample factors ({2**num_blocks} * stem_stride)'
assert all(h % d_factor == 0 for d_factor in possible_downsample_factors), \
f'Image height must be divisible by all possible downsample factors ({2**num_blocks} * stem_stride)'
ss_kwargs['builder_kwargs'] = {
'op_subset': op_subset,
'stem_strides': stem_strides,
'num_blocks': num_blocks,
'downsample_block_max_ops': downsample_block_max_ops,
'skip_block_max_ops': skip_block_max_ops,
'upsample_block_max_ops': upsample_block_max_ops,
'post_upsample_max_ops': post_upsample_max_ops
}
ss_kwargs['model_kwargs'] = {
'num_classes': num_classes,
'in_channels': in_channels,
}
self.img_size = img_size
self.in_channels = in_channels
super().__init__(StackedHourglass, hgnet_param_tree_factory, **ss_kwargs)

Просмотреть файл

@ -0,0 +1,49 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from functools import partial
from itertools import chain
import torch
from torch import nn
class Conv2dSamePadding(nn.Conv2d):
__doc__ = nn.Conv2d.__doc__
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
pad_shape = tuple(chain(*[
[k // 2 + (k - 2 * (k // 2)) - 1, k // 2]
for k in self.kernel_size[::-1]
]))
self.pad = nn.ZeroPad2d(pad_shape)
def forward(self, x: torch.Tensor) -> torch.Tensor:
return self._conv_forward(self.pad(x), self.weight, self.bias)
class ReluConv2d(nn.Module):
def __init__(self, in_channels: int, out_channels: int,
kernel_size: int = 3, stride: int = 1,
bias: bool = False, **kwargs):
super().__init__()
self.conv = Conv2dSamePadding(
in_channels, out_channels, kernel_size=kernel_size,
stride=stride, bias=bias
)
self.bn = nn.BatchNorm2d(out_channels)
self.act = nn.ReLU()
def forward(self, x: torch.Tensor):
return self.act(self.bn(self.conv(x)))
OPS = {
'conv3x3': partial(ReluConv2d, kernel_size=3),
'conv5x5': partial(ReluConv2d, kernel_size=5),
'conv7x7': partial(ReluConv2d, kernel_size=7),
}

Просмотреть файл

@ -0,0 +1,3 @@
[flake8]
ignore = E111,E402,E722,W503,W504,F405,F403
max-line-length = 120

17
tasks/face_segmentation/snpe/.vscode/launch.json поставляемый Normal file
Просмотреть файл

@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true,
"args":["001c3ee6c74e05e63252b1ba3dfc58ca3cbb4f56"]
}
]
}

Просмотреть файл

@ -0,0 +1,52 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import json
import sys
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
def cleanup_stale_pods(store: ArchaiStore):
""" This script looks for kubernetes pods that are no longer running (e.g. the pod may have run out of
memory or may have been stopped for whatever reason) and cleans up the state in our status table to
ensure the job doesn't get zombied, it will be picked up by the next available pod. """
SCRIPT_DIR = os.path.dirname(__file__)
sys.path += [os.path.join(SCRIPT_DIR, '..', 'util')]
from shell import Shell
shell = Shell()
podinfo = shell.run(os.getcwd(), "kubectl get pods -n snpe -o json", print_output=False)
podinfo = json.loads(podinfo)
running = []
for row in podinfo['items']:
name = row['metadata']['name']
status = row['status']['phase']
if status == 'Running':
running += [name]
print(name, status)
# unlock rows that belong to non-existent kubernetes pods.
for e in store.get_all_status_entities(status='completed', not_equal=True):
name = e['name']
if 'node' in e and e['node']:
node = e['node']
status = e['status'] if 'status' in e else 'none'
print(f"Found lock by {node} with status {status}")
if node.startswith('snpe-quantizer') and node not in running:
print(f"Clearing lock on non-existant pod: {node}")
del e['node']
store.update_status_entity(e)
if __name__ == '__main__':
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
print(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(con_str)
store = ArchaiStore(storage_account_name, storage_account_key)
cleanup_stale_pods(store)

Просмотреть файл

@ -0,0 +1,50 @@
import argparse
import csv
def read_status(filename):
header = None
with open(filename, 'r') as f:
reader = csv.reader(f, delimiter=',')
for row in reader:
header = [x.strip() for x in row]
break
result = {}
with open(filename, 'r') as f:
reader = csv.DictReader(f, fieldnames=header, delimiter=',')
next(reader) # skip the header row.
for row in reader:
if 'name' in row:
key = row['name']
result[key] = row
return result
def compare(file1, file2):
m1 = read_status(file1)
m2 = read_status(file2)
for key in m1:
if key in m2:
r1 = m1[key]
r2 = m2[key]
if 'mean' not in r1:
print(f'model {key} in {file1} is missing: mean')
elif 'mean' not in r2:
print(f'model {key} is {file2} missing: mean')
elif 'f1_1k' not in r1:
print(f'model {key} in {file1} is missing: f1_1k')
elif 'f1_1k' not in r2:
print(f'model {key} is {file2} missing: f1_1k')
else:
print(f"{key}, {r1['mean']}, {r2['mean']}, {r1['f1_1k']}, {r2['f1_1k']}")
else:
print(f'model {key} NOT FOUND in {file2}')
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Compare the results from 2 status files in .csv format.')
parser.add_argument('file1', help='The first .csv file name.')
parser.add_argument('file2', help='The second .csv file name.')
args = parser.parse_args()
compare(args.file1, args.file2)

Просмотреть файл

@ -0,0 +1,29 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
def delete(con_str):
parser = argparse.ArgumentParser(description='Delete a model from azure using its friendly name')
parser.add_argument('name', help='The friendly name allocated by the upload script.')
parser.add_argument('--file', help='Delete just the one file associated with the friendly name.')
args = parser.parse_args()
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(con_str)
store = ArchaiStore(storage_account_name, storage_account_key)
store.delete_blobs(args.name, args.file)
if not args.file:
store.delete_status(args.name)
if __name__ == '__main__':
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
print(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
delete(con_str)

Просмотреть файл

@ -0,0 +1,39 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
def download(con_str):
parser = argparse.ArgumentParser(
description="Download assets from azure blob store using friendly name.")
parser.add_argument('--name', help='Friendly name of model to download (if not provided it downloads them all')
parser.add_argument('--file', help='The optional name of the files to download instead of getting them all.')
args = parser.parse_args()
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(con_str)
store = ArchaiStore(storage_account_name, storage_account_key)
friendly_name = args.name
if not friendly_name:
friendly_names = [e['name'] for e in store.get_all_status_entities()]
else:
friendly_names = [friendly_name]
specific_file = args.file
for friendly_name in friendly_names:
downloaded = store.download(friendly_name, friendly_name, specific_file)
if len(downloaded) == 0 and specific_file:
print(f"file {specific_file} not found")
if __name__ == '__main__':
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
print(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
download(con_str)

Просмотреть файл

@ -0,0 +1,80 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
import json
import statistics
from status import get_all_status_entities, update_status_entity
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
STDEV_THRESHOLD = 10 # redo any runs that have a stdev > 10% of the mean.
MAX_COUNT = 100
def find_unsteady_runs(threshold, reset, limit=None):
conn_string = os.getenv(CONNECTION_NAME)
if not conn_string:
print(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
wobbly = []
# Check standard deviation and if it is more than %5 of the mean then
# reset the total_inference_avg so it re-runs.
for e in get_all_status_entities():
name = e['name']
if 'total_inference_avg' in e and 'model_date' in e:
total_inference_avg = json.loads(e['total_inference_avg'])
if len(total_inference_avg) < 2:
continue
stdev = int(statistics.stdev(total_inference_avg))
mean = int(statistics.mean(total_inference_avg))
changed = False
if 'stdev' not in e:
e['stdev'] = int((stdev * 100) / mean)
changed = True
r = int(stdev * 100 / mean)
if r >= threshold:
print(f"Found {name}, with mean {mean}, stdev {stdev} which is {r}% of the mean")
wobbly += [e]
if changed:
update_status_entity(e)
if reset:
s = sorted(wobbly, key=lambda e: e['model_date'])
s.reverse()
if limit:
print(f"Found {len(s)} wobbly jobs, but limiting reset to the newest {limit} jobs")
s = s[0:limit]
for e in s:
name = e['name']
print(f"Resetting {name} total_inference_avg={e['total_inference_avg']}...")
del e['total_inference_avg']
e['status'] = 'reset'
update_status_entity(e)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Reset jobs that have a stdev above a given percentage level ' +
'and optionally reset them so they they run again.')
parser.add_argument(
'--threshold', type=int,
help=f'What percentage stddev to use as threshold (default {STDEV_THRESHOLD}).',
default=STDEV_THRESHOLD)
parser.add_argument(
'--limit', type=int,
help=f'Maximum number of jobs to reset (default {MAX_COUNT}).',
default=MAX_COUNT)
parser.add_argument(
'--reset',
help='Reset the runs found to be unsteady so they run again.',
action="store_true")
args = parser.parse_args()
if args.threshold < 1:
print("### threshold must be greater than 1")
else:
find_unsteady_runs(args.threshold, args.reset, args.limit)

Просмотреть файл

@ -0,0 +1,30 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
def list_models(con_str):
parser = argparse.ArgumentParser(
description="List all azure blob store assets.")
parser.add_argument('--prefix', type=str, required=True, default=None,
help='List models matching this prefix')
args = parser.parse_args()
prefix = args.prefix
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(con_str)
store = ArchaiStore(storage_account_name, storage_account_key)
for blob in store.list_blobs(prefix):
print(blob)
if __name__ == '__main__':
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
print(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
list_models(con_str)

Просмотреть файл

@ -0,0 +1,17 @@
#!/bin/bash
# If the python app runs out of memory due to various leaks in python libraries
# the process terminates with 'killed', this loop will restart the runner.
script_dir="$(dirname ${BASH_SOURCE})"
source ~/anaconda3/etc/profile.d/conda.sh
conda activate snap37
while true
do
python ${script_dir}/runner.py $@
if [ $? != 0 ]; then
exit 0
fi
echo "sleeping for 30 seconds..."
sleep 30
done

Просмотреть файл

@ -0,0 +1,56 @@
# Azure Setup
This Azure code connects to an Azure Storage account by a connection string setup in an environment variable named
`MODEL_STORAGE_CONNECTION_STRING`.
There is a handy [setup.ps1](../docker/quantizer/setup.ps1) powershell script that will setup a new Azure Storage
account and print this connection string key for you using the Azure CLI.
You can get the connection string from your Azure Storage account under `Access Keys` and `Show Keys` and copy the one
named `Connection string`.
In Linux you should use double quotes around the connection string like this:
```
export MODEL_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=mymodels;AccountKey=...==;EndpointSuffix=core.windows.net"
```
You'll use it a lot so it is handy if you put it in your `~/.profile`.
Then you can use the scripts here as follows:
1. `upload.py` - upload a new model, it will allocate a friendly name for your model if you
can't think of one. All the charts and graphs and tables are more readable if you stick with
the allocated friendly names. But the actual model file names can be whatever large name you need.
1. `download.py` - can download all azure blob assets associated with the given friendly name.
This can include the .onnx model, all test results, and converted .dlc models.
1. `priority_queue.py` - is just a helper class.
1. `reset.py` - sometimes you want to re-test a model if something went wrong, this can reset
the `state` of a job by it's friendly name.
1. `status.py` - can download all the status info from the Azure Table in .csv format.
1. `delete.py` - sometimes a model turns out to be junk, so you can delete a row in the table and it's
associated azure blob folder with this handy script.
1. `runner.py` - this is the magic script that runs everything. See below.
## Runner
Then to get the ball rolling create a temp folder and run this:
```
mkdir -p ~/experiment
python ~/git/archai/tasks/face_Segmentation/snpe/azure/runner.py --working ~/experiment
```
This will monitor the Azure blob store for new work to do, and run those jobs in priority order. If you also provide a
`--device` option pointing to the `adb device` for a Qualcomm 888 Dev Board then it will also run the quantized models
on that device and report the performance and F1 score results.
If you setup a quantization only runner in the cloud using the `docker/quantizer` image, you can pass
`--no_quantization` argument when you have a `--device` so that the local runs do not do quantization. This will stop
your linux machine from getting overloaded with quantization work so it can focus on the SNPE device workloads.

Просмотреть файл

@ -0,0 +1,124 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
import dateutil.parser
import datetime
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
def parse_date(date):
s = f"{date}".strip()
date = dateutil.parser.isoparse(s)
date = date.replace(tzinfo=datetime.timezone.utc)
return date
def get_usage_by_device(store: ArchaiStore, report_start, report_end):
devices = {}
first = None
last = None
for e in store.get_all_status_entities():
device = e['name']
start = parse_date(e['start'])
end = parse_date(e['end'])
if report_start is not None and report_start > start:
continue
if report_end is not None and report_end < start:
continue
if report_end is not None and end > report_end:
end = report_end
if device not in devices:
devices[device] = []
devices[device] += [(start, end)]
if first is None or start < first:
first = start
if last is None or end > last:
last = end
return (devices, first, last)
def report(store: ArchaiStore, report_start, report_end):
devices, first, last = get_usage_by_device(store, report_start, report_end)
if first is None:
print("No data found")
return
# column headings
print("date,{}".format(",".join([k for k in devices])))
start = datetime.datetime(first.year, first.month, first.day, 0, 0, 0, 0, first.tzinfo)
last = datetime.datetime(last.year, last.month, last.day, 23, 59, 59, 999999, first.tzinfo)
while start < last:
du = []
end = start + datetime.timedelta(days=1)
total = (end - start).total_seconds()
for k in devices:
s = devices[k]
used = 0
for d in s:
ds = d[0]
de = d[1]
if ds > end or de < start:
continue
if ds < start:
ds = start
if de > end:
de = end
u = (de - ds).total_seconds()
if u < 0:
print("?")
used += u
x = int((used * 100) / total)
du += [x]
st = start.strftime("%x")
print("{},{}".format(st, ",".join([str(x) for x in du])))
start = end
total_seconds = (last - first).total_seconds()
total_used = []
for k in devices:
s = devices[k]
used = 0
for d in s:
u = (d[1] - d[0]).total_seconds()
used += u
x = int((used * 100) / total_seconds)
total_used += [x]
print("total,{}".format(",".join([str(x) for x in total_used])))
if __name__ == '__main__':
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
print(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
parser = argparse.ArgumentParser(
description='Report on Qualcomm device utilization in an optional date range. ' +
'Reports percentage utilization per day.')
parser.add_argument('--start', help='Set the "start" date to start the search. (default None).')
parser.add_argument('--end', help='Set the "end" date to end the search. (default None).')
args = parser.parse_args()
start = None
end = None
if args.start:
start = dateutil.parser.parse(args.start)
start = start.replace(tzinfo=datetime.timezone.utc)
if args.end:
end = dateutil.parser.parse(args.end)
end = end.replace(tzinfo=datetime.timezone.utc)
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(con_str)
store = ArchaiStore(storage_account_name, storage_account_key, table_name='usage')
report(store, start, end)

Просмотреть файл

@ -0,0 +1,43 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
def reset(con_str):
parser = argparse.ArgumentParser(
description='Reset the named entity.')
parser.add_argument('name', help='The friendly name to reset or "*" to reset all rows', default=None)
args = parser.parse_args()
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(con_str)
store = ArchaiStore(storage_account_name, storage_account_key)
entities = []
if args.name == "*":
entities = [e for e in store.get_all_status_entities()]
else:
e = store.get_existing_status(args.name)
if e is None:
print(f"Entity {args.name} not found")
sys.exit(1)
else:
entities = [e]
for e in entities:
name = e['name']
print(f"Resetting {name}")
store.reset(e['name'], ['benchmark_only', 'model_date'])
store.delete_blobs(name, 'model.dlc')
store.delete_blobs(name, 'model.quant.dlc')
if __name__ == '__main__':
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
print(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
reset(con_str)

Просмотреть файл

@ -0,0 +1,855 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# See Readme.md
import argparse
import json
import os
import sys
import glob
import time
from datetime import datetime
import platform
import statistics
import tracemalloc
import gc
import psutil
import logging
import traceback
from shutil import rmtree
from archai.common.store import ArchaiStore
from usage import add_usage
from cleanup_stale_pods import cleanup_stale_pods
from azure.data.tables import EntityProperty, EdmType
# This file contains wrappers on the snpe execution of the model connecting everything
# to the Azure table describing the jobs that need to be run, and keeping the status
# rows up to date while these jobs are running.
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
SNPE_OUTPUT_DIR = 'snpe_output'
MODEL_DIR = 'model'
SNPE_MODEL_DIR = 'snpe_models'
SNPE_OUTPUT_DIR = 'snpe_output'
MAX_BENCHMARK_RUNS = 5
BENCHMARK_INPUT_SIZE = 50
CLEAR_RANDOM_INPUTS = 0
LOG_FILE_NAME = 'memusage.log'
DEVICE_FILE = "device.txt"
UNIQUE_NODE_ID = None
BENCHMARK_RUN_COUNT = 0
SCRIPT_DIR = os.path.dirname(__file__)
sys.path += [os.path.join(SCRIPT_DIR, '..', 'snpe')]
sys.path += [os.path.join(SCRIPT_DIR, '..', 'util')]
sys.path += [os.path.join(SCRIPT_DIR, '..', 'vision')]
rss_start = None
# Set the logging level for all azure-* libraries
logging.getLogger('azure').setLevel(logging.ERROR)
logging.getLogger('azure.core.pipeline.policies.http_logging_policy').setLevel(logging.ERROR)
from test_snpe import convert_model, quantize_model, run_benchmark
from test_snpe import run_batches, set_device, get_device
from create_data import create_dataset
from collect_metrics import get_metrics
from priority_queue import PriorityQueue
from test_onnx import test_onnx
from dlc_helper import get_dlc_metrics
logger = logging.getLogger(__name__)
store : ArchaiStore = None
usage : ArchaiStore = None
def log(msg):
print(msg)
logger.info(msg)
def log_error(error_type, value, stack):
log(f'### Exception: {error_type}: {value}')
for line in traceback.format_tb(stack):
log(line.strip())
def read_shape(dir):
shape_file = os.path.join(dir, 'shape.txt')
if os.path.isfile(shape_file):
with open(shape_file, 'r', encoding='utf-8') as f:
return eval(f.readline().strip())
return [0, 0, 0]
def save_shape(dir, shape):
shape_file = os.path.join(dir, 'shape.txt')
with open(shape_file, 'w', encoding='utf-8') as f:
f.write(str(shape))
return [0, 0, 0]
def check_device(device):
set_device(device)
device_info = ''
if os.path.isfile(DEVICE_FILE):
with open(DEVICE_FILE, 'r', encoding='utf-8') as f:
device_info = f.readline().strip()
if device_info != device:
with open(DEVICE_FILE, 'w', encoding='utf-8') as f:
f.write(f"{device}\n")
def check_dataset(shape, name, test_size):
w, h, c = shape
img_size = (w, h)
test = os.path.join('data', name)
if os.path.isdir(test):
s = read_shape(test)
if s != shape:
log(f"recreating {name} folder since shape needs to change from {s} to {shape}")
rmtree(test)
else:
bins = [x for x in os.listdir(test) if x.endswith('.bin')]
if len(bins) != test_size:
log(f"recreating test folder since it had {len(bins)} images")
rmtree(test)
if not os.path.isdir(test):
create_dataset(dataset, name, img_size, test_size)
save_shape(test, shape)
def get_entity_shape(entity, name):
if name in entity:
return eval(entity[name])
return []
def record_error(entity, error_message):
global store
entity['status'] = 'error'
entity['error'] = error_message
store.merge_status_entity(entity)
def convert(name, entity, long_name, model_path):
global store
log("Converting model: " + long_name)
entity['model_name'] = long_name
entity['status'] = 'converting'
store.merge_status_entity(entity)
model_dir = os.path.join(name, SNPE_MODEL_DIR)
model, input_shape, output_shape, error = convert_model(model_path, model_dir)
if error:
record_error(entity, error)
return 'error'
if input_shape != get_entity_shape(entity, 'shape') or output_shape != get_entity_shape(entity, 'output_shape'):
entity['shape'] = str(input_shape)
entity['output_shape'] = str(output_shape)
store.merge_status_entity(entity)
log("Uploading converted model: " + model)
store.upload_blob(name, model)
return model
def quantize(name, entity, onnx_model, model):
global store
log("Quantizing model: " + name + "...")
log(" (Please be patient this can take a while, up to 10 minutes or more)")
entity['status'] = 'quantizing'
store.merge_status_entity(entity)
input_shape = eval(entity['shape'])
check_dataset(input_shape, 'quant', 1000)
snpe_model_dir = os.path.join(name, SNPE_MODEL_DIR)
model, error = quantize_model(model, onnx_model, snpe_model_dir)
if error:
record_error(entity, error)
return 'error'
# save the quantized .dlc since it takes so long to produce.
log("Uploading quantized model: " + model)
store.upload_blob(name, model)
return model
def get_unique_node_id():
global UNIQUE_NODE_ID
if UNIQUE_NODE_ID:
return UNIQUE_NODE_ID
return platform.node()
def set_unique_node_id(id):
global UNIQUE_NODE_ID
UNIQUE_NODE_ID = id
def is_locked(entity):
node = get_unique_node_id()
if 'node' in entity and entity['node']:
name = entity['name']
locked = entity['node']
if locked != node:
log(f"{node}: model {name} is running on: {locked}")
return 'busy'
return None
def lock_job(entity):
global store
node = get_unique_node_id()
name = entity['name']
# make sure we have the most up to date version of the entity.
entity = store.get_status(name)
retries = 10
while retries:
retries -= 1
if is_locked(entity):
# someone beat us to it
raise Exception('lock encountered')
entity['node'] = node
try:
store.merge_status_entity(entity)
break
except Exception as e:
# someone beat us to it!
log(f"lock failed: {e}")
log("entity may have been changed by someone else, trying again...")
# make sure we really got the lock!
entity = store.get_status(name)
if 'node' in entity and entity['node'] == node:
return entity
# someone beat us to it
raise Exception('lock encountered')
def unlock_job(entity):
global store
node = get_unique_node_id()
# make sure we have the most up to date version of the entity.
entity = store.get_status(entity['name'])
if 'node' in entity:
if entity['node'] and entity['node'] != node:
lock = entity['node']
raise Exception(f'cannot unlock entity because it is locked by someone else ({lock})')
else:
entity['node'] = ''
retries = 10
while retries:
retries -= 1
try:
store.merge_status_entity(entity)
break
except:
# someone beat us to it!
log("unlock failed, entity changed by someone else, trying again...")
return entity
def run_onnx(name, dataset, model_path, test_size):
out_dir = os.path.join(name, SNPE_OUTPUT_DIR, 'onnx_outputs')
if os.path.isdir(out_dir):
rmtree(out_dir)
test_onnx(dataset, model_path, out_dir, test_size)
return out_dir
def is_complete(entity, prop):
return prop in entity
def is_true(entity, prop):
return prop in entity and entity[prop]
def get_total_inference_avg(entity):
if 'total_inference_avg' in entity and entity['total_inference_avg']:
try:
return json.loads(entity['total_inference_avg'])
except:
pass
return []
def benchmarks_complete(entity):
return len(get_total_inference_avg(entity))
def get_mean_benchmark(entity):
avg = get_total_inference_avg(entity)
if len(avg) > 0:
return statistics.mean(avg)
return 0
def get_avg_latency(latencies):
count = 0
sum = 0
for m in latencies:
for ifs in m['total_inference_time']:
sum += float(ifs)
count += 1
return sum / count
def benchmark(entity, onnx_model, model, name, test_input):
global BENCHMARK_RUN_COUNT, CLEAR_RANDOM_INPUTS, store, usage
# next highest priority is to get benchmark times
total_benchmark_runs = benchmarks_complete(entity)
if (total_benchmark_runs >= MAX_BENCHMARK_RUNS):
return False # nothing to do
if total_benchmark_runs < MAX_BENCHMARK_RUNS:
BENCHMARK_RUN_COUNT += 1
if CLEAR_RANDOM_INPUTS > 0 and BENCHMARK_RUN_COUNT >= CLEAR_RANDOM_INPUTS:
clear_random_inputs()
BENCHMARK_RUN_COUNT = 0
log(f"Running benchmark iteration {total_benchmark_runs} of {MAX_BENCHMARK_RUNS}...")
entity['status'] = 'running benchmark'
store.merge_status_entity(entity)
start = store.get_utc_date()
# TODO: calibrate the duration from 10 seconds to whatever time would produce the best results...
output_dir, latencies = run_benchmark(onnx_model, model, test_input, 10, name)
ifs = get_avg_latency(latencies)
end = store.get_utc_date()
add_usage(usage, get_device(), start, end)
for file in glob.glob(os.path.join(output_dir, 'perf_results*.csv')):
store.upload_blob(name, file)
total_inference_avg = get_total_inference_avg(entity)
total_inference_avg += [ifs]
entity['total_inference_avg'] = json.dumps(total_inference_avg)
mean = statistics.mean(total_inference_avg)
entity['mean'] = mean
if len(total_inference_avg) > 1:
stdev = statistics.stdev(total_inference_avg)
entity['stdev'] = (stdev * 100) / mean
total_benchmark_runs += 1
else:
mean = get_mean_benchmark(entity)
if is_benchmark_only(entity, False) and total_benchmark_runs == MAX_BENCHMARK_RUNS:
entity['status'] = 'complete'
entity['completed'] = store.get_utc_date()
store.merge_status_entity(entity)
return True
def ensure_complete(entity):
global store
if entity['status'] != 'complete':
entity['status'] = 'complete'
name = entity['name']
log(f"Completed {name}")
store.merge_status_entity(entity)
def run_model(name, dataset, use_device, benchmark_only, no_quantization):
global store, usage
log("===================================================================================================")
log(f"Checking model: {name} on node {get_unique_node_id()}")
log("===================================================================================================")
with open('name.txt', 'w', encoding='utf-8') as file:
file.write(name + '\n')
# make sure we have a clean slate and don't pick up old files from previous runs
model_dir = os.path.join(name, MODEL_DIR)
if os.path.isdir(model_dir):
rmtree(model_dir)
os.makedirs(model_dir)
snpe_model_dir = os.path.join(name, SNPE_MODEL_DIR)
if os.path.isdir(snpe_model_dir):
rmtree(snpe_model_dir)
snpe_output_dir = os.path.join(name, SNPE_OUTPUT_DIR)
if os.path.isdir(snpe_output_dir):
rmtree(snpe_output_dir)
benchmark_dir = os.path.join(name, 'benchmark')
if os.path.isdir(benchmark_dir):
rmtree(benchmark_dir)
entity = store.get_status(name)
downloaded = store.download(name, model_dir, r'.*\.onnx$')
if len(downloaded) == 0 or not os.path.isfile(downloaded[0]):
record_error(entity, 'missing model')
log(f"### no model found for {name}")
return
onnx_model = downloaded[0]
long_name = os.path.basename(onnx_model)
# see if we have converted the model or not.
# do this first no matter what.
converted = len(store.list_blobs(f'{name}/model.dlc')) > 0
is_quantized = len(store.list_blobs(f'{name}/model.quant.dlc')) > 0
if not is_quantized:
# oh, the quant model disappeared so clear the flag so it gets
# quantized again by a machine that can do that.
if 'quantized' in entity:
del entity['quantized']
store.update_status_entity(entity)
if no_quantization:
return
if 'shape' not in entity:
# hmmm, a bad reset? Then pretend it is not converted so we get the shape back.
converted = False
if not converted:
model = convert(name, entity, long_name, onnx_model)
if model == 'error':
return
elif converted:
downloaded = store.download(name, snpe_model_dir, 'model.dlc')
if len(downloaded) == 0:
raise Exception('### internal error, the model.dlc download failed!')
elif not is_quantized and not converted:
record_error(entity, 'missing model')
log(f"### no model found for {name}")
return
# see if we have a quantized model or not.
model = os.path.join(snpe_model_dir, 'model.dlc')
if not is_quantized:
model = quantize(name, entity, onnx_model, model)
if model == 'error':
return
entity['quantized'] = True
if 'macs' in entity:
del entity['macs'] # need to redo it since we re-quantized.
store.update_status_entity(entity)
else:
entity['quantized'] = True
store.merge_status_entity(entity)
quantized_model = os.path.join(snpe_model_dir, 'model.quant.dlc')
if not os.path.isfile(quantized_model):
downloaded = store.download(name, snpe_model_dir, 'model.quant.dlc')
if len(downloaded) == 0 or not os.path.isfile(downloaded[0]):
raise Exception("??? quantized model should exist at this point...")
quantized_model = downloaded[0]
if 'macs' not in entity:
csv_data, macs, params = get_dlc_metrics(quantized_model)
entity['macs'] = macs
entity['params'] = params
entity['status'] = 'converted'
store.merge_status_entity(entity)
csv_file = os.path.join(snpe_model_dir, 'model.quant.info.csv')
with open(csv_file, 'w') as f:
f.write(csv_data)
store.upload_blob(name, csv_file)
return
input_shape = eval(entity['shape'])
if use_device:
check_dataset(input_shape, 'test', 1000)
test_input = os.path.realpath(os.path.join('data', 'test'))
if benchmark(entity, onnx_model, quantized_model, name, test_input):
return
if benchmark_only:
log(f"Benchmark only has nothing to do on model {name}")
ensure_complete(entity)
return
# next highest priority is to get the 1k f1 score.
test_size = 0
prop = None
if use_device and not is_complete(entity, 'f1_1k'):
test_size = 1000
prop = 'f1_1k'
model = quantized_model # use the quantized model
elif use_device and not is_complete(entity, 'f1_1k_f'):
test_size = 1000
prop = 'f1_1k_f'
if not converted:
# this is a model that is prequantized, we don't have the original
entity[prop] = 'n/a'
entity['status'] = '.dlc model not found'
store.merge_status_entity(entity)
return
os.remove(quantized_model) # make sure we can't run this one.
elif use_device and not is_complete(entity, 'f1_10k'):
test_size = 10000
prop = 'f1_10k'
model = quantized_model # use the quantized model
elif not is_complete(entity, 'f1_onnx'):
test_size = 10000
prop = 'f1_onnx'
model = onnx_model
else:
# why are we here?
return
log(f"==> running {prop} test using model {model}")
# copy model to the device.
if prop != 'f1_onnx':
# now that we have the shape, we can create the appropriate quant and test
# datasets!
check_dataset(input_shape, 'test', test_size)
if prop == 'f1_onnx':
entity['status'] = f'Running {prop}'
store.merge_status_entity(entity)
snpe_output_dir = run_onnx(name, dataset, onnx_model, test_size)
else:
entity['status'] = f'Running {prop}'
store.merge_status_entity(entity)
test_input = os.path.realpath(os.path.join('data', 'test'))
start = store.get_utc_date()
snpe_output_dir, latencies = run_batches(onnx_model, model, test_input, name)
end = store.get_utc_date()
add_usage(usage, get_device(), start, end)
try:
use_pillow = 'use_pillow' in entity and entity['use_pillow']
num_classes = 19
if 'output_shape' in entity:
w, h, num_classes = eval(entity['output_shape'])
test_results, chart, f1score = get_metrics(input_shape, False, dataset, snpe_output_dir, num_classes,
use_pillow)
except Exception as ex:
record_error(entity, str(ex))
return
log(f"### Saving {prop} score of {f1score}")
entity[prop] = f1score
store.merge_status_entity(entity)
store.upload_blob(name, test_results, f"test_results_{prop}.csv")
store.upload_blob(name, chart, f"pr_curve_{prop}.png")
if 'f1_1k' in entity and 'f1_10k' in entity and 'f1_1k_f' in entity and 'f1_onnx' in entity:
ensure_complete(entity)
def clear_random_inputs():
if os.path.isdir('random_inputs'):
log("Clearing random_inputs.")
rmtree('random_inputs')
def is_benchmark_only(entity, benchmark_only):
benchmark_only_flag = benchmark_only
if 'benchmark_only' in entity:
benchmark_only_flag = int(entity['benchmark_only'])
return benchmark_only_flag
def node_quantizing():
""" Ee don't want to do more than one quantization at a time on a given node
because it is an CPU intensive operation. """
global store
id = platform.node() + '_'
count = 0
for e in store.get_all_status_entities(status='complete', not_equal=True):
status = ''
if 'status' in e:
status = e['status']
if 'node' not in e:
continue
node = e['node']
if node.startswith(id) and node != get_unique_node_id() and \
(status == 'converting' or status == 'quantizing'):
count += 1
return count > 0
def check_stale_pods(timeout=3600):
""" This function checks whether any quantization jobs are getting stuck in the
kubernetes cluster for longer than the given timeout and automatically resets them
if the kubernetes pod no longer exists. """
global store
clean = False
for entity in store.get_all_status_entities(status='complete', not_equal=True):
if is_locked(entity):
node = entity['node']
if node.startswith("snpe-quantizer"):
utc_format = "%Y-%m-%dT%H:%M:%SZ"
if 'check' not in entity:
entity['check'] = datetime.strftime(datetime.utcnow(), utc_format)
store.merge_status_entity(entity)
else:
start_time = datetime.strptime(entity['check'], utc_format)
diff = datetime.utcnow() - start_time
if diff.seconds > timeout:
clean = True
break
if clean:
cleanup_stale_pods(store)
for entity in store.get_all_status_entities(status='complete', not_equal=True):
if 'check' in entity:
del entity['check']
store.update_status_entity(entity)
# flake8: noqa: C901
def find_work_prioritized(use_device, benchmark_only, subset_list, no_quantization):
global store
queue = PriorityQueue()
quantizing = no_quantization or node_quantizing()
for entity in store.get_all_status_entities(status='complete', not_equal=True):
name = entity['name']
if subset_list is not None and name not in subset_list:
log(f"# skipping model {name} because it is in the subset list")
continue
total_benchmark_runs = benchmarks_complete(entity)
if is_locked(entity):
log(f"# skip entity {name} because someone else is working on it")
continue
if 'error' in entity:
log(f"# skipping {name} because something went wrong on previous step.")
continue
if not is_complete(entity, 'macs') or not is_true(entity, 'quantized'):
if quantizing:
if no_quantization:
log(f"This node is running with --no_quantization, skipping mode '{name}' for now until " +
"quantization cluster completes.")
else:
log(f"Skipping model '{name}' for now until other quantization finishes on our node")
continue
priority = 20
elif use_device and (total_benchmark_runs < MAX_BENCHMARK_RUNS):
priority = 30 + total_benchmark_runs
elif is_benchmark_only(entity, benchmark_only):
continue
elif not is_complete(entity, 'f1_onnx'):
priority = 60
elif use_device and not is_complete(entity, 'f1_1k'):
priority = 100 + get_mean_benchmark(entity)
elif use_device and not is_complete(entity, 'f1_1k_f'):
priority = 100 + get_mean_benchmark(entity) * 10
elif use_device and not is_complete(entity, 'f1_10k'):
# prioritize by how fast the model is!
priority = 100 + get_mean_benchmark(entity) * 100
else:
# this model is done!
continue
if 'priority' in entity:
# allow user to override the priority
priority = int(entity['priority'])
queue.enqueue(priority, entity)
return queue
def garbage_collect():
# remove old folders so we don't grow disk usage forever
now = time.time()
one_day = 60 * 60 * 24
for f in list(os.listdir()):
if os.path.isdir(f) and f != 'data' and f != 'random_inputs' and f != 'DEVICE_FILE':
mod = os.path.getmtime(f)
if now - mod > one_day:
log(f"Garbage collecting {f}...")
rmtree(f)
class MemoryMonitor:
def __init__(self):
self.rss_start = None
self.growth = 0
def heap_growth(self):
rss = psutil.Process(os.getpid()).memory_info().rss
if self.rss_start is None:
self.rss_start = rss
growth = rss / self.rss_start
logging.info(f"========= memory rss={rss} growth={growth}============")
return growth
def monitor(dataset, use_device, benchmark_only, subset_list, no_quantization):
global rss_start, store, usage
logging.basicConfig(filename=LOG_FILE_NAME, filemode='a',
level=logging.INFO,
format='%(asctime)s - %(levelname)s: %(message)s',
datefmt='%m/%d/%Y %I:%M:%S %p')
monitor = MemoryMonitor()
file_mod = os.path.getmtime(__file__)
# terminate this script if the memory has grown too much or the script
# itself has been modified. This will cause the outer 'loop.sh' to
# loop and start a fesh process and pick any code modifications.
while monitor.heap_growth() < 10:
if file_mod != os.path.getmtime(__file__):
log("Code has changed, need to restart.")
return 0
try:
queue = find_work_prioritized(use_device, benchmark_only, subset_list, no_quantization)
except Exception as e:
log(f"Error in find_work_prioritized: {e}")
time.sleep(60)
continue
if queue.size() == 0:
log("No work found.")
return 0
else:
garbage_collect()
# do the top priority job then go back to find_work_prioritized in case
# other jobs were add/completed in parallel while this was executing.
priority, entity = queue.dequeue()
name = entity['name']
try:
entity = lock_job(entity)
benchmark_only_flag = is_benchmark_only(entity, benchmark_only)
gc.collect()
tracemalloc.start()
snapshot1 = tracemalloc.take_snapshot()
run_model(name, dataset, use_device, benchmark_only_flag, no_quantization)
gc.collect()
snapshot2 = tracemalloc.take_snapshot()
for i in snapshot2.compare_to(snapshot1, 'lineno')[:10]:
logging.info(i)
unlock_job(entity)
except Exception as e:
error_type, value, stack = sys.exc_info()
if str(e) == 'lock encountered':
log('model is running on another machine')
elif 'ConnectionResetError' in str(e):
log('ConnectionResetError: Ignoring Azure flakiness...')
unlock_job(entity)
else:
# bug in the script somewhere... don't leave the node locked.
log_error(error_type, value, stack)
unlock_job(entity)
sys.exit(1)
time.sleep(10) # give other machines a chance to grab work so we don't get stuck in retry loops.
# we terminate here to reclaim the leaked memory, and to ensure we shut down cleanly without
# leaving any rows in the table locked, we have an outer loop.sh script that will restart the runner.
log("Memory leak detected")
return 0
def get_storage_account(con_str):
parts = con_str.split(';')
for part in parts:
name_value = part.split('=')
if name_value[0] == 'AccountName' and len(name_value) > 1:
return name_value[1]
def setup_store():
global store, usage
conn_string = os.getenv(CONNECTION_NAME)
if not conn_string:
log(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(conn_string)
store = ArchaiStore(storage_account_name, storage_account_key, table_name='status')
usage = ArchaiStore(storage_account_name, storage_account_key, table_name='usage')
return conn_string
def check_environment():
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
log(f"Please set your {CONNECTION_NAME} environment variable.")
sys.exit(1)
print(f'Using storage account: "{get_storage_account(con_str)}"')
snpe_root = os.getenv("SNPE_ROOT")
if not snpe_root:
log("Please specify your 'SNPE_ROOT' environment variable.")
sys.exit(1)
if not os.path.isdir(snpe_root):
log(f"Your SNPE_ROOT '{snpe_root} is not found.")
sys.exit(1)
sys.path += [f'{snpe_root}/benchmarks', f'{snpe_root}/lib/python']
ndk = os.getenv("ANDROID_NDK_ROOT")
if not ndk:
log("you must have a ANDROID_NDK_ROOT installed, see the ../device/readme.md")
sys.exit(1)
if not os.path.isdir(ndk):
log(f"Your ANDROID_NDK_ROOT '{ndk} is not found.")
sys.exit(1)
dataset = os.getenv("INPUT_DATASET")
if not dataset:
log("please provide --input or set your INPUT_DATASET environment variable")
sys.exit(1)
if not os.path.isdir(dataset):
log(f"Your INPUT_DATASET '{dataset} is not found.")
sys.exit(1)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Test the models as they appears in our Azure table')
parser.add_argument('--device', '-d', help='Specify which Qualcomm device device to use (default None).')
parser.add_argument('--benchmark', help='Run benchmark tests only (no F1 tests).', action="store_true")
parser.add_argument('--max_benchmark_runs', type=int, help='Set maximum number of benchmark runs per model ' +
'(default 5).', default=5)
parser.add_argument('--subset', help='Comma separated list of friendly model names to focus on, ' +
'ignoring all other models.')
parser.add_argument('--clear_random_inputs', type=int, help='How many benchmark runs before clearing ' +
'random_inputs (default 0 means no clearing).', default=0)
parser.add_argument('--no_quantization', help='Do not do any quantization work on this machine.',
action="store_true")
parser.add_argument('--working', help='Use this working folder for all downloaded models and temp files ' +
'(default cwd).')
parser.add_argument('--cleanup_stale_pods', type=int, help='specify how often (in seconds) to check for stale ' +
'kubernetes pods that need to be cleaned up. You can also run this manually, see ' +
'the clean_stale_pods.py script.', default=0)
args = parser.parse_args()
check_environment()
if args.working:
log(f"Using working folder: {args.working}")
os.chdir(args.working)
logger.setLevel('INFO')
logger.addHandler(logging.FileHandler('runner.log', 'a'))
setup_store()
MAX_BENCHMARK_RUNS = args.max_benchmark_runs
CLEAR_RANDOM_INPUTS = args.clear_random_inputs
device = args.device
if device:
set_unique_node_id(f"{platform.node()}_{device}")
check_device(device)
else:
set_unique_node_id(platform.node())
subset = None
if args.subset:
subset = [x.strip() for x in args.subset.split(',')]
if args.cleanup_stale_pods:
check_stale_pods(args.cleanup_stale_pods)
dataset = os.getenv("INPUT_DATASET")
rc = monitor(dataset, device is not None, args.benchmark, subset, args.no_quantization)
sys.exit(rc)

Просмотреть файл

@ -0,0 +1,39 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
def status(con_str):
parser = argparse.ArgumentParser(description='Print status in .csv format')
parser.add_argument('--status', help='Optional match for the status column (default None).')
parser.add_argument('--name', help='Optional name of single status row to return (default None).')
parser.add_argument('--not_equal', '-ne', help='Switch the match to a not-equal comparison.', action="store_true")
parser.add_argument('--locked', help='Find entities that are locked by a node.', action="store_true")
parser.add_argument('--cols', help='Comma separated list of columns to report (default is to print all)')
args = parser.parse_args()
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(con_str)
store = ArchaiStore(storage_account_name, storage_account_key)
entities = store.get_all_status_entities(args.status, args.not_equal)
if args.locked:
entities = [e for e in entities if 'node' in e and e['node']]
if args.name:
entities = [e for e in entities if 'name' in e and e['name'] == args.name]
columns = None
if args.cols:
columns = [x.strip() for x in args.cols.split(',')]
store.print_entities(entities, columns)
if __name__ == '__main__':
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
print(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
status(con_str)

Просмотреть файл

@ -0,0 +1,26 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
def unlock(con_str):
parser = argparse.ArgumentParser(
description='Unlock all jobs for given node or unlock all jobs.')
parser.add_argument('--node', help='Optional node name (default None).')
args = parser.parse_args()
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(con_str)
store = ArchaiStore(storage_account_name, storage_account_key)
store.unlock_all(args.node)
if __name__ == '__main__':
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
print(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
unlock(con_str)

Просмотреть файл

@ -0,0 +1,31 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
def upload(con_str, args):
parser = argparse.ArgumentParser(description='Upload a named model (and optional accompanying files) to your ' +
'azure blob store')
parser.add_argument('name', help='Friendly name of the folder to put this in.')
parser.add_argument('file', help='Path to the file to upload to Azure ' +
'or a folder to upload all files in that folder to the same azure blob folder.')
parser.add_argument('--priority', type=int, help='Optional priority override for this job. ' +
'Larger numbers mean lower priority')
parser.add_argument('--reset', help='Reset stats for the model if it exists already.', action="store_true")
args = parser.parse_args(args)
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(con_str)
store = ArchaiStore(storage_account_name, storage_account_key)
store.upload(args.name, args.file, args.reset, priority=args.priority)
if __name__ == '__main__':
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
print(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
upload(con_str)

Просмотреть файл

@ -0,0 +1,65 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
import uuid
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
USAGE_TABLE_NAME = 'USAGE_TABLE_NAME'
USAGE_TABLE = 'usage'
CONNECTION_STRING = ''
def get_all_usage_entities(store, name_filter=None):
""" Get all usage entities with optional device name filter """
table_client = store._get_table_client()
entities = []
query = "PartitionKey eq 'main'"
if name_filter:
query += f" and name eq '{name_filter}'"
try:
for e in table_client.query_entities(query_filter=query):
entities += [e]
except Exception as e:
print(f"### error reading table: {e}")
return entities
def add_usage(store, name, start, end):
e = store.get_status(str(uuid.uuid4()))
del e['status']
e['name'] = name
e['start'] = start
e['end'] = end
store.update_status_entity(e)
return e
def usage(con_str):
parser = argparse.ArgumentParser(
description='Print usage in .csv format using ' +
f'{CONNECTION_NAME} environment variable.')
parser.add_argument('--device', help='Optional match for the name column (default None).')
args = parser.parse_args()
storage_account_name, storage_account_key = ArchaiStore.parse_connection_string(con_str)
store = ArchaiStore(storage_account_name, storage_account_key, table_name=USAGE_TABLE)
entities = get_all_usage_entities(store, args.device)
store.print_entities(entities)
if __name__ == '__main__':
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
print(f"Please specify your {CONNECTION_NAME} environment variable.")
sys.exit(1)
usage(con_str)

Просмотреть файл

@ -0,0 +1,84 @@
FROM ubuntu:18.04
SHELL ["/bin/bash", "-c"]
ARG SNPE_SDK_ZIP
ARG SNPE_SDK_ROOT
ARG ANDROID_NDK_ZIP
ARG ANDROID_NDK_ROOT
RUN apt-get update && apt-get install -y build-essential libtool autoconf cmake unzip wget git unzip curl python3 python3-dev python3-distutils python3-pip ffmpeg libsm6 libxext6 wget locales libjpeg-dev zlib1g zlib1g-dev libprotobuf-dev protobuf-compiler
# need cmake 3.22 to build latest version of onnx-simplifier on Ubuntu 18
RUN apt update && \
apt install -y software-properties-common lsb-release && \
apt clean all
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
RUN apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF7F09730B3F0A4
RUN apt update && apt install -y cmake
# build latest version of protobuf needed by onnx
RUN git clone https://github.com/protocolbuffers/protobuf.git
RUN cd protobuf && \
git checkout v3.19.4 && \
git submodule update --init --recursive && \
mkdir build_source && cd build_source && \
cmake ../cmake -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release && \
make -j$(nproc) && \
make install
# have to ensure default locale is utf-8 otherwise python bails with this error:
# UnicodeEncodeError: 'ascii' codec can't encode character '\xe7' in position 17: ordinal not in range(128)
RUN locale-gen en_US.UTF-8
# copy and unzip the SNPE SDK
WORKDIR /home/archai/snpe
COPY "${SNPE_SDK_ZIP}" .
RUN unzip "${SNPE_SDK_ZIP}"
# Copy and unzip the Android NDK
WORKDIR /home/archai/ndk
COPY "${ANDROID_NDK_ZIP}" .
RUN unzip "${ANDROID_NDK_ZIP}"
WORKDIR /home/archai
ENV AZUREML_CONDA_ENVIRONMENT_PATH="/home/archai/miniconda3/snap37"
ENV SNPE_ROOT="/home/archai/snpe/$SNPE_SDK_ROOT"
ENV SNPE_ANDROID_ROOT="/home/archai/snpe/$SNPE_SDK_ROOT"
ENV ANDROID_NDK_ROOT="/home/archai/ndk/$ANDROID_NDK_ROOT"
ENV PATH="/home/archai/miniconda3/bin:$PATH:/home/archai:/home/archai/ndk/tools/${PLATFORM_TOOLS_ROOT}:/home/archai/snpe/${SNPE_SDK_ROOT}/bin/x86_64-linux-clang"
ENV LC_ALL="en_US.UTF-8"
ENV PYTHONPATH="/home/archai/snpe/$SNPE_SDK_ROOT/lib/python"
ENV LD_LIBRARY_PATH="${AZUREML_CONDA_ENVIRONMENT_PATH}/lib:${SNPE_SDK_ROOT}/lib/x86_64-linux-clang:${LD_LIBRARY_PATH}"
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN bash Miniconda3-latest-Linux-x86_64.sh -b -p ./miniconda3
RUN conda init bash
RUN conda create -y -n snap37 python=3.8 pip=20.2.4
ENV PATH="${AZUREML_CONDA_ENVIRONMENT_PATH}/bin:$PATH"
RUN wget -O azcopy_v10.tar.gz https://aka.ms/downloadazcopy-v10-linux && tar -xf azcopy_v10.tar.gz --strip-components=1
# this echo is a trick to bypass docker build cache.
# simply change the echo string every time you want docker build to pull down new bits.
RUN echo '04/06/2023 06:28 PM' >/dev/null && git clone https://github.com/microsoft/archai.git
RUN cd archai && git checkout task_segmentation && pip install -e .[dev]
RUN echo "using this pip version: " && which pip
RUN echo "using this python version: " && which python
RUN pushd /home/archai/archai/tasks/face_segmentation/snpe && \
python --version && \
pip install -r requirements.txt
RUN pip list
# This container starts running immediately so that the kubernetes cluster simply scales
# automatically based on how busy this script is (see HorizontalPodAutoscaler in quantizer.yaml).
COPY run.sh /home/archai/run.sh
RUN ls -al /home/archai
RUN cat run.sh
RUN chmod u+x /home/archai/run.sh
CMD ["bash", "-c", "/home/archai/run.sh"]

Просмотреть файл

@ -0,0 +1,49 @@
<#
.SYNOPSIS
.
.DESCRIPTION
This is a handy powershell script that can cleanup old images from your azure container registry.
You can find the password in your Azure portal for the container registry under the tab named Access Keys.
.PARAMETER password
Specifies a password.
#>
param(
[Parameter(Mandatory=$true)]
[string]$password
)
$registry_name = "snpecontainerregistry001"
$tags = &az acr repository show-tags -n $registry_name --repository quantizer | ConvertFrom-JSON
if ($tags.GetType().Name -eq "String"){
# there is only one tag
Write-Host "Your registry is already clean, it contains only one image quantizer:$tags"
Exit 0
}
$latest = [Version]"0"
foreach ($t in $tags) {
Write-Host "Found tag $t"
$v = [Version]$t
if ($v -gt $latest){
$latest = $v
}
}
$a = Read-Host "Do you want to delete all images except the latest version $latest (y/n)? "
if ($a -ne "y") {
Exit 1
}
foreach ($t in $tags) {
$v = [Version]$t
if ($v -ne $latest) {
Write-Host "Deleting image quantizer:$t"
Write-Host "az acr repository delete --name $registry_name --image quantizer:$v -u $registry_name -p $password"
$rc = &az acr repository delete --name $registry_name --image quantizer:$v -u $registry_name -p $password --yes
}
}

Просмотреть файл

@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: snpe-quantizer
namespace: snpe
spec:
replicas: 1
selector:
matchLabels:
app: snpe-quantizer
template:
metadata:
labels:
app: snpe-quantizer
spec:
containers:
- name: snpe-quantizer
image: snpecontainerregistry001.azurecr.io/quantizer:1.0
resources:
limits:
cpu: 4
env:
- name: MODEL_STORAGE_CONNECTION_STRING
value: $MSCS$
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: snpe-quantizer
namespace: snpe
spec:
maxReplicas: 100 # define max replica count
minReplicas: 1 # define min replica count
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: snpe-quantizer
targetCPUUtilizationPercentage: 40 # target CPU utilization

Просмотреть файл

@ -0,0 +1,135 @@
# Readme
This folder contains some handy stuff for setting up an Azure account so you can run the code in the
[Azure](../../azure/readme.md) folder and create a docker image for running SNPE model quantization
jobs on a kubernetes cluster. You can also run this docker image in a Linux container on Windows
using the Docker Desktop for Windows.
First you will need to decide which Azure Subscription to use, install the
[Azure Command Line Interface](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli)
and run `az account set --subscription id` to make the this subscription your default.
## setup.ps1
This [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-linux?view=powershell-7.3)
script creates the azure resources in your chosen subscription needed by the `runner.py` script.
This includes a storage account for storing models and a status table, and a usage table. The script
contains a default `$plan_location` of `westus2`, feel free to change that to whatever you need. It
also creates an azure docker container registry and AKS kubernetes cluster, but using the Kubernetes
cluster for model quantization is optional, you can run the `runner.py` script without AKS.
The setup script requires the following environment variables be set before hand:
- **SNPE_SDK** - points to a local zip file containing SNPE SDK (we have tested version `snpe-2.5.0.4052.zip`)
- **ANDROID_NDK** - points to a local zip file containing the Android NDK zip file (we have tested version `android-ndk-r25c-linux.zip`)
- **INPUT_TESTSET** - points to a local zip file containing 10,000 image test set from your dataset.
The [SNPE Readme](../../snpe/readme.md) shows where to find those zip files.
After running this script you will see further instructions, first a docker command line in case you
want to build the docker image that runs in a kubernetes cluster. Second, you will see a
`set MODEL_STORAGE_CONNECTION_STRING=...` that you can set for your system so that subsequent scripts
talk to the right azure storage account. On linux this would be an export in your `~/.profile`, and
don't forget the double quotes.
```
export MODEL_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=mymodels;AccountKey=...==;EndpointSuffix=core.windows.net"
```
## Dockerfile
This builds a docker image that you can run in a Azure Kubernetes cluster that will do SNPE model
quantization in the cloud. This frees up your Linux box that is managing Qualcomm devices and helps
you increase your Qualcomm device utilization.
The `setup.ps1` script shows what docker commands to run to build the image, how to login to your
azure docker container registry, how to take your image for that container registry and push it
to Azure. So you do not need to use the public docker.org container registry. You will decide
what version number to attach to your image here and the same version needs to be specified in the
following `quantizer.yaml`.
You can also test your docker image locally by running:
```
docker run -e MODEL_STORAGE_CONNECTION_STRING=$MODEL_STORAGE_CONNECTION_STRING -it <image_id>
```
If you need to debug your docker image interactively you can run this instead:
```
docker run -it <image_id> /bin/bash
```
Then you can poke around the `run.sh` and other things to verify things manually.
## Publish image to your Azure Container Registry
First you need to tag your newly created image with the correct name:
```
docker tag <image_id> snpecontainerregistry001.azurecr.io/quantizer:1.27
```
You can find the correct version in the `quantizer.yaml` file that was updated by `setup.ps1`.
Then you can push this image to your Azure Container Registry named `snpecontainerregistry001`. You
can configure your local docker so it can talk to this Azure Kubernetes cluster (AKS). The Azure
Portal has a connect script under the AKS resource Overview. You will see a `Connect` button
that shows a string like this:
```
az aks get-credentials --resource-group snpe-quantizaton-rg --name snpe-quantizer-aks
```
Run that locally and then you can push docker images to this registry.:
```
docker push snpecontainerregistry001.azurecr.io/quantizer:1.27
```
Again, make sure you specify the right version here. The `setup.ps1` script will automatically
increment this version number each time it runs in case you need to push new versions of this image.
## quantizer.yaml
Then you can use `kubectl apply -f quantizer.yaml` to configure the AKS custer. Note that the version
of the image to use is specified in this file so you may need to edit the file and change the
version `1.13` to whatever you just tagged and pushed to the azure container registry.
Notice this yaml configures AKS to scale up to 100 nodes if necessary and the scaling is triggered
when a given node passes 40% CPU utilization. You can tweak these numbers however you like to fit
your budget. But you may be surprised by how cheap AKS is. In a month of quantizing over 8000
models, the Azure cost analysis shows a total cost of around $8. A drop in the bucket compared to
model training costs. The AKS cluster auto-scales, so most of the time it is scaled down to 1 node
and sitting idle, generating very little cost.
This quantizer runs in the `snpe` kubernetes namespace, and you can make this your default namespace
by running:
```
kubectl config set-context --current --namespace=snpe
```
You can run `kubectl get pods` to see what is running in Azure and you should see something like this:
```
NAME READY STATUS RESTARTS AGE
snpe-quantizer-54dcf74c99-kfj8p 0/1 ContainerCreating 0 4s
snpe-quantizer-845c7cfcd8-q8kjh 1/1 Running 0 47h
```
You can watch what these pods are doing by running:
```
kubectl logs snpe-quantizer-54dcf74c99-kfj8p -f
```
And you will see some output like this:
```
Sleeping for 30 seconds...
Using storage account: "nasfacemodels"
snpe-quantizer-d9f4b6c96-jsb7q: model test is running on: clovett-14_e6dc0375
# skip entity test because someone else is working on it
No work found.
Sleeping for 30 seconds...
```
This is good and means the pod is waiting for work to show up in the `status` table in your
Azure storage account. You can now use the [upload.py](../../azure/upload.py) script to upload a
face segmentation ONNX model to do a test run. You can train one of these models using
[train.py](../../../train.py) to train one of good model architectures listed in
[archs/snp_target](../../../archs/snp_target).
## run.sh
This little script is used as the entry point to the Docker image, you will see this in the last
`RUN` command in the Dockerfile.

Просмотреть файл

@ -0,0 +1,23 @@
azure-storage-blob
azure-data-tables
azureml-mlflow
scikit-image
scikit-learn
scikit-build
protobuf==3.20
opencv-contrib-python
matplotlib
onnx==1.11.0
onnxruntime
onnx-simplifier
importlib-metadata
packaging
cryptography
psutil
tqdm
pandas
scipy
numpy
ipykernel
sphinx
pyyaml

Просмотреть файл

@ -0,0 +1,26 @@
#!/bin/bash
mkdir -p /home/archai/experiment
export INPUT_DATASET=/home/archai/datasets/FaceSynthetics
if [[ ! -d $INPUT_DATASET ]]; then
mkdir -p $INPUT_DATASET
pushd $INPUT_DATASET
azcopy copy https://nasfacemodels.blob.core.windows.net/downloads/099000.zip .
unzip 099000.zip
rm -rf 099000.zip
popd
fi
python -m olive.snpe.configure
pushd /home/archai/experiment
while true
do
python -u /home/archai/archai/tasks/face_segmentation/snpe/azure/runner.py
if [ $? != 0 ]; then
echo "Script returned an error code!"
fi
echo "Sleeping for 30 seconds..."
sleep 30
done

Просмотреть файл

@ -0,0 +1,249 @@
# assumes you have already run "az login" and "az account set --subscription id"
# also assumes you have run "az aks install-cli"
$resource_group = "snpe-quantizaton-rg"
$storage_account_name = "nasfacemodels"
$plan_location = "westus2"
$aks_cluster = "snpe-quantizer-aks"
$aks_node_vm = "Standard_D16s_v3"
$aks_namespace = "snpe"
# This registry name is also referenced in quantizer.yaml
$registry_name = "snpecontainerregistry001"
function Check-Provisioning($result) {
$rc = Join-String -Separator "`n" -InputObject $rc
$x = ConvertFrom-Json $rc
if ($x.provisioningState -ne "Succeeded") {
Write-Error "Failed to create registry"
Write-Error $rc
exit 1
}
}
function GetConnectionString()
{
$x = az storage account show-connection-string --name $storage_account_name --resource-group $resource_group | ConvertFrom-Json
return $x.connectionString
}
function CreateBlobContainer($name, $conn_str)
{
Write-Host "Checking blob container '$name' exists"
$rc = &az storage container exists --name $name --connection-string $conn_str | ConvertFrom-Json
if (-not $rc.exists) {
Write-Host "Creating blob container $name"
$rc = &az storage container create --name $name --resource-group $resource_group --connection-string $conn_str | ConvertFrom-Json
if (-not $rc.created) {
Write-Error "Failed to create blob container $name"
Write-Error $rc
}
}
}
function EnablePublicAccess($name, $conn_str){
Write-Host "Checking blob container '$name' has public access"
$rc = &az storage container show-permission --name $name --connection-string $conn_str | ConvertFrom-Json
if ($rc.publicAccess -ne "blob" ){
Write-Host "Setting blob container '$name' permissions for public access"
$rc = &az storage container set-permission --name $name --public-access blob --connection-string $conn_str
}
}
function GetZipRootName($zip)
{
$zip = [IO.Compression.ZipFile]::OpenRead($zip)
$entries = $zip.Entries
$root = [System.IO.Path]::GetDirectoryName($entries[0].FullName)
$zip.Dispose()
return $root
}
function CopyLocal($zip)
{
$a = [System.IO.Path]::GetDirectoryName([System.IO.Path]::GetFullPath($zip))
$b = [System.IO.Path]::GetFullPath(".")
if ($a -ne $b) {
Copy-Item -Path $zip -Destination "."
}
}
function EnsureNamespace($name)
{
Write-Host "Checking kubernetes namespaces"
$rc = &kubectl get namespace $name 2>&1
if ($rc.ToString().Contains("NotFound")) {
Write-Host "Creating kubernetes namespace $name" 2>&1
$rc = &kubectl create namespace $name
Write-Host "Create returned: $rc"
}
}
if ("$Env:SNPE_SDK" -eq "")
{
Write-Host "Please set your SNPE_SDK path so we can upload the SNPE SDK zip file to Azure"
exit 1
}
CopyLocal -zip $Env:SNPE_SDK
$snpe_sdk_zip = [System.IO.Path]::GetFileName($Env:SNPE_SDK)
$snpe_root = GetZipRootName -zip $Env:SNPE_SDK
if ("$Env:ANDROID_NDK" -eq ""){
Write-Host "Please set your ANDROID_NDK path so we can upload the Android NDK zip file to Azure"
exit 1
}
CopyLocal -zip $Env:ANDROID_NDK
$android_sdk_zip = [System.IO.Path]::GetFileName($Env:ANDROID_NDK)
$android_ndk_root = GetZipRootName -zip $Env:ANDROID_NDK
if ("$Env:INPUT_TESTSET" -eq ""){
Write-Host "Please set your INPUT_TESTSET path pointing to zip file containing the 10k test set images"
exit 1
}
Write-Host "Checking azure account..."
$output = &az account show 2>&1
if ($output.Contains("ERROR:"))
{
Write-Host "Please login to an azure account using 'az login' and set the subscription you want to use."
Write-Host "using 'az account set --subscriptoin id' then try again."
Exit 1
}
$account = $output | ConvertFrom-Json
$name = $account.name
$subscription = $account.id
Write-Host "You are using azure subscription $name with id $subscription"
$proceed = Read-Host -Prompt "Do you want to proceed (y/n) "
$lower = $proceed.ToLowerInvariant()
if ($lower -ne 'yes' -and $lower -ne 'y'){
Write-Host "Your answer $lower does not match 'yes' or 'y' so the script is terminating."
Exit 1
}
# ======= Storage account
Write-Host Checking storage account $storage_account_name...
$rc = &az storage account show --resource-group $resource_group --name $storage_account_name 2>&1
$rc = Join-String -Separator "`n" -InputObject $rc
if ($rc.Contains("ResourceNotFound")) {
Write-Host Creating storage account $storage_account_name...
$rc = &az storage account create --name $storage_account_name --resource-group $resource_group --location $plan_location --kind StorageV2 --sku Standard_LRS 2>&1
}
Check-Provisioning -result $rc
$conn_str = GetConnectionString
CreateBlobContainer -name "models" -conn_str $conn_str
CreateBlobContainer -name "downloads" -conn_str $conn_str
EnablePublicAccess -name "downloads" -conn_str $conn_str
Write-Host Checking container registry $registry_name
$rc = &az acr show --resource-group $resource_group --name $registry_name 2>&1
if ($rc.Contains("ResourceNotFound")) {
Write-Host Creating container registry $registry_name...
$rc = &az acr create --resource-group $resource_group --name $registry_name --sku Standard 2>&1
Check-Provisioning -result $rc
$rc = &az acr update --name $registry_name --anonymous-pull-enabled true --admin-enabled true
}
Check-Provisioning -result $rc
$rc = &az acr login --name $registry_name --expose-token | ConvertFrom-Json
$token = $rc.accessToken
$acrServer = $rc.loginServer
# ======= aks cluster
Write-Host Checking aks cluster..
$rc = &az aks show --name $aks_cluster --resource-group $resource_group 2>&1
if ($rc.Contains("ResourceNotFound")) {
# note, azure requires min of 10 pods per node, but our pods are running expensive quantization job, so
# to allow 10 of those to run on a node we've had to scale up our VM to Standard_D16s_v3 with 16 cores and 64 gb RAM.
# even then we'll see how well that performs... could be 10 quantizations on a node will thrash it to bits...
$rc = &az aks create --name $aks_cluster --resource-group $resource_group --location $plan_location --enable-cluster-autoscaler `
--node-osdisk-size 250 --min-count 1 --max-count 10 --max-pods 10 --node-osdisk-size 100 --node-vm-size $aks_node_vm `
--node-osdisk-type Managed --nodepool-name nodepool1 2>&1
}
Check-Provisioning -result $rc
$rc = &"$env:windir\system32\where" kubectl.exe 2>&1
print("where kubectl.exe => $rc")
if ($rc.ToString().Contains("Could not find files")) {
Write-Host "kubectl not found, skipping kubectl setup."
if ($IsWindows){
Write-Host "You can build the quantizer docker image on Windows if you install the Docker Desktop for Windows"
Write-Host "and set it to Linux container mode and you can manage your Azure Kubernetes cluster using kubectl if"
Write-Host "you enable the docker desktop Kubernetes support under Settings."
}
}
else
{
# this makes it possible to use kubectl locally to manage this cluster.
&az aks get-credentials --resource-group $resource_group --name $aks_cluster
EnsureNamespace -name $aks_namespace
}
Write-Host "======= upload INPUT_TESTSET"
$fileName = [System.IO.Path]::GetFileName($Env:INPUT_TESTSET)
$rc = az storage blob exists --account-name $storage_account_name --container-name downloads --name $fileName --connection-string $conn_str | ConvertFrom-Json
if ($rc.exists){
Write-Host "File $fileName already exists in 'downloads' container"
} else {
Write-Host "Uploading $fileName to 'downloads' container"
az storage blob upload --file "$Env:INPUT_TESTSET" --account-name $storage_account_name --container-name downloads --name $fileName --connection-string "$conn_str"
}
$test_set_url="https://$storage_account_name.blob.core.windows.net/downloads/$fileName"
Write-Host "Test set url is $test_set_url"
# populate MODEL_STORAGE_CONNECTION_STRING variable in quantizer.template.yaml
$template = Get-Content -Path "quantizer.template.yaml"
$tags = &az acr repository show-tags -n $registry_name --repository quantizer | ConvertFrom-JSON
if ($tags.GetType().Name -eq "String"){
$tags = @($tags)
}
$latest = [Version]"1.0"
foreach ($t in $tags) {
$v = [Version]$t
if ($v -gt $latest){
$latest = $v
}
}
$v = [Version]$latest
$vnext = [System.String]::Format("{0}.{1}", $v.Major, $v.Minor + 1)
Write-Host "Creating quantizer.yaml and setting image version $vnext"
$template = $template.Replace("quantizer:1.0", "quantizer:$vnext")
$template = $template.Replace("$MSCS$", $conn_str)
Set-Content -Path "quantizer.yaml" -Value $template
# ================= Write out info/next steps ================
Write-Host ""
Write-Host docker build `
--build-arg "SNPE_SDK_ZIP=$snpe_sdk_zip" --build-arg "SNPE_SDK_ROOT=$snpe_root" `
--build-arg "ANDROID_NDK_ZIP=$android_sdk_zip" --build-arg "ANDROID_NDK_ROOT=$android_ndk_root" `
. --progress plain
Write-Host ""
Write-Host "### Run the above docker build to build the docker image and the following to publish it..."
Write-Host "Get the password from Azure portal for $registry_name under Access keys:"
Write-Host " docker login $acrServer -u $registry_name -p <get password>"
Write-Host " az aks get-credentials --resource-group $resource_group --name $aks_cluster"
Write-Host " docker tag ... $registry_name.azurecr.io/quantizer:$vnext"
Write-Host " docker push $registry_name.azurecr.io/quantizer:$vnext"
Write-Host ""
Write-Host "To cleanup old images see cleanup.ps1"
Write-Host ""
Write-Host "### Apply the new image on your cluster..."
Write-Host " kubectl apply -f quantizer.yaml"
Write-Host ""
Write-Host "### To run the runner script locally please set the following environment variable: "
Write-HOst "set MODEL_STORAGE_CONNECTION_STRING=$conn_str"

Просмотреть файл

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<DirectedGraph xmlns="http://schemas.microsoft.com/vs/2009/dgml">
<Nodes>
<Node Id="..." Bounds="-891.259155273438,-397.317448474421,50,25.96" UseManualLocation="True" />
<Node Id="...1" Bounds="-899.17041015625,-141.018983432007,50,25.96" Label="..." UseManualLocation="True" />
<Node Id="AzureBlobStore" Bounds="-1193.71833333333,-519.02,106.03,25.96" Label="azure blob store" UseManualLocation="True" />
<Node Id="AzureStatusTable" Bounds="-1193.71833333333,-445.02,112.973333333333,25.96" Label="azure status table" UseManualLocation="True" />
<Node Id="JupyterNotebook" Bounds="-1396.73103800456,-328.529480438232,115.163333333333,25.96" Label="Jupyter Notebook" UseManualLocation="True" />
<Node Id="KubernetesCluster" Bounds="-1208.17041666667,-308.193725585938,119.78,25.96" Label="Kubernetes Cluster" UseManualLocation="True" />
<Node Id="QualcommDevice" Bounds="-769.718333333333,-534.029998779297,115.2,25.96" Label="Qualcomm device" UseManualLocation="True" />
<Node Id="QualcommDevice1" Bounds="-771.540833333333,-453.524998168945,115.2,25.96" Label="Qualcomm device" UseManualLocation="True" />
<Node Id="Runner.py" Bounds="-903.436666666667,-534.04,70.4533333333334,25.96" Label="runner.py" UseManualLocation="True" />
<Node Id="Runner.py1" Bounds="-900.436666666666,-453.277548474121,70.4533333333334,25.96" Label="runner.py" UseManualLocation="True" />
<Node Id="Runner.py2" Bounds="-899.452100016276,-313.899282537842,70.4533333333334,25.96" Label="runner.py" UseManualLocation="True" />
<Node Id="Runner.py3" Bounds="-903.170422770182,-257.939182537842,70.4533333333334,25.96" Label="runner.py" UseManualLocation="True" />
<Node Id="Runner.py4" Bounds="-901.449353434245,-196.979083432007,70.4533333333334,25.96" Label="runner.py" UseManualLocation="True" />
<Node Id="SnpeQuantiation" Bounds="-760.452083333333,-251.989580438032,109.126666666667,25.96" Label="snpe quantiation" UseManualLocation="True" />
<Node Id="SnpeQuantization" Bounds="-765.452083333333,-319.111862182617,114.553333333333,25.96" Label="snpe quantization" UseManualLocation="True" />
<Node Id="Test_onnx" Bounds="-761.731038004557,-196.029480438032,70.6,25.96" Label="test_onnx" UseManualLocation="True" />
<Node Id="Upload" Bounds="-1358,-486,56.9533333333334,25.96" Label="upload" UseManualLocation="True" />
</Nodes>
<Links>
<Link Source="AzureBlobStore" Target="Runner.py" Bounds="-1087.68830810547,-518.622952023936,175.265282619028,9.66072548941548" />
<Link Source="AzureBlobStore" Target="Runner.py1" Bounds="-1088.87310498647,-493.671486483734,179.682249037085,42.8785481723203" />
<Link Source="AzureBlobStore" Target="Runner.py2" Bounds="-1123.20784148837,-493.060008544922,234.258958940773,173.798238915231" />
<Link Source="AzureStatusTable" Target="JupyterNotebook" Bounds="-1308.85493100781,-419.059993286133,149.124540767732,86.0330250379735" />
<Link Source="AzureStatusTable" Target="Runner.py" Bounds="-1100.05297851563,-505.965637207031,188.762878417969,60.9456481933594" />
<Link Source="AzureStatusTable" Target="Runner.py1" Bounds="-1128.9501953125,-459.267211914063,219.597229003906,14.2472229003906" />
<Link Source="AzureStatusTable" Target="Runner.py2" Bounds="-1125.57153320313,-419.059997558594,218.665649414063,102.314849853516" />
<Link Source="KubernetesCluster" Target="Runner.py2" Bounds="-1088.39039550781,-300.030978319804,179.940110471371,3.61429271166003" />
<Link Source="KubernetesCluster" Target="Runner.py3" Bounds="-1088.48298803671,-284.494147681096,176.453782358855,31.6319870791329" />
<Link Source="KubernetesCluster" Target="Runner.py4" Bounds="-1115.36108846197,-282.233729858398,207.979818936008,82.0059196880921" />
<Link Source="Runner.py" Target="AzureStatusTable" Bounds="-1131.49816894531,-516.163635253906,228.0615234375,69.8030700683594" />
<Link Source="Runner.py" Target="QualcommDevice" Bounds="-832.983324788411,-521.057729225212,54.2649914734869,0.00347075341346681" />
<Link Source="Runner.py1" Target="AzureStatusTable" Bounds="-1096.17529296875,-453.341644287109,195.738647460938,11.53271484375" />
<Link Source="Runner.py1" Target="QualcommDevice1" Bounds="-829.983324788411,-440.436044683939,49.4425034983809,0.0808848954610539" />
<Link Source="Runner.py2" Target="AzureStatusTable" Bounds="-1130.11853027344,-414.711029052734,230.666442871094,107.175262451172" />
<Link Source="Runner.py2" Target="SnpeQuantization" Bounds="-828.998766682943,-303.91817535817,54.5517017881938,1.8222062802526" />
<Link Source="Runner.py3" Target="SnpeQuantiation" Bounds="-832.717089436849,-243.665883447078,63.271065419621,2.32289765526392" />
<Link Source="Runner.py4" Target="Test_onnx" Bounds="-830.996020100911,-183.759789886113,60.2651897407106,0.409381159973066" />
<Link Source="Upload" Target="AzureBlobStore" Bounds="-1301.04664876302,-495.218628273773,98.4628791895163,17.2187510083821" />
<Link Source="Upload" Target="AzureStatusTable" Bounds="-1301.04664876302,-466.951233796788,99.2138483678966,21.1438396495243" />
</Links>
<Properties>
<Property Id="Bounds" DataType="System.Windows.Rect" />
<Property Id="Label" Label="Label" Description="Displayable label of an Annotatable object" DataType="System.String" />
<Property Id="UseManualLocation" DataType="System.Boolean" />
</Properties>
</DirectedGraph>

Двоичные данные
tasks/face_segmentation/snpe/images/system.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 28 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -0,0 +1,103 @@
import numpy as np
from scipy import interpolate
from scipy import spatial
from functools import reduce
def spline_fit(xs, ys):
indexes = np.argsort(np.array(xs), axis=0)
ixs = []
iys = []
for i in indexes:
ixs += [xs[i]]
iys += [ys[i]]
f = interpolate.UnivariateSpline(ixs, iys)
f.set_smoothing_factor(0.1)
xn = np.linspace(ixs[0], ixs[-1], 100)
return [xn, f(xn)]
def filter_(pts, pt):
"""
Get all points in pts that are not Pareto dominated by the point pt
"""
weakly_worse = (pts <= pt).all(axis=-1)
strictly_worse = (pts < pt).any(axis=-1)
return pts[~(weakly_worse & strictly_worse)]
def get_pareto_undominated_by(pts1, pts2=None):
"""
Return all points in pts1 that are not Pareto dominated
by any points in pts2
"""
if pts2 is None:
pts2 = pts1
return reduce(filter_, pts2, pts1)
def get_pareto_frontier(pts):
"""
Iteratively filter points based on the convex hull heuristic
"""
pareto_groups = []
# loop while there are points remaining
while pts.shape[0]:
# brute force if there are few points:
if pts.shape[0] < 10:
pareto_groups.append(get_pareto_undominated_by(pts))
break
# compute vertices of the convex hull
hull_vertices = spatial.ConvexHull(pts).vertices
# get corresponding points
hull_pts = pts[hull_vertices]
# get points in pts that are not convex hull vertices
nonhull_mask = np.ones(pts.shape[0], dtype=bool)
nonhull_mask[hull_vertices] = False
pts = pts[nonhull_mask]
# get points in the convex hull that are on the Pareto frontier
pareto = get_pareto_undominated_by(hull_pts)
pareto_groups.append(pareto)
# filter remaining points to keep those not dominated by
# Pareto points of the convex hull
pts = get_pareto_undominated_by(pts, pareto)
return np.vstack(pareto_groups)
def pareto_curve(Xs, Ys):
# in our case faster is better so invert the X axis
pts = np.array(list(zip(Xs, Ys))) * np.array((-1, 1))
result = get_pareto_frontier(pts)
indices = []
for pt in result:
i = np.where(pts == pt)[0][0]
indices += [i]
return indices
def get_pareto_edges(xs, ys):
left = None
top = None
bottom = None
right = None
for i in range(len(xs)):
x = xs[i]
y = ys[i]
if left is None or x < left:
left = x
if bottom is None or y < bottom:
bottom = y
if top is None or y > top:
top = y
if right is None or x > right:
right = x
return (left, bottom, right, top)

Просмотреть файл

@ -0,0 +1,70 @@
# Readme
This folder contains code that automates the testing of ONNX models across one or more machines that are connected via
USB to Qualcomm 888 boards.
The code is organized into:
1. [SNPE Device Code](snpe/readme.md) that knows how to use the Qualcomm Neural Processing SDK to talk to the device,
convert ONNX models to .dlc, quantize them, and test them on the board using the Android `adb` tool.
1. [Azure Code](azure/readme.md) that talks to a configured Azure storage account for uploading models to test,
downloading them, uploading test results, and keeping an Azure table "status" that summarizes results of all your
models.
1. [Docker](docker/quantizer/readme.md) scripts for setting up your Azure account and optionally creating a docker image
for running in an Azure Kubernetes cluster to do model quantization using the Qualcomm Neural Processing SDK.
Quantization is time consuming so having an elastic scale speeds things up a lot.
1. [Notebooks](notebook/gallery_performance.md) contains a Jupyter Notebook that can visualize the results from the
Azure "status" table.
It is best if you setup a new Conda Python environment for Python 3.10 with the `requirements.txt` included here using:
```shell
pip install -r requirements.txt
```
The SNPE SDK only works on Linux, so you need a Linux machine with this repo. Then follow additional setup in each of
the above readmes.
## Workflow
The overall workflow looks like this. One or more Linux machines are setup as above and are running `azure/runner.py`
including a Kubernetes cluster setup for quantization (see [docker/quantizer](docker/quantizer) folder).
![system](images/system.png)
Each instance of `runner.py` looks for work, and executes it in priority order where the prioritization is defined by
the `find_work_prioritized` function in the runner. This script is completely restartable, and can distribute the work
across multiple instances of the runner script. Each instance will pick up where a previous one left off based on what
it finds in your "status" Azure table. The prioritization maps to the columns of the status table as follows:
1. **macs:** convert to .dlc and post Macs score and `snpe-dlc-viewer` output and do model quantization (runs on Linux) - priority 20
1. **total_inference_avg** run `snpe_bench.py` with quantized model on Qualcomm device DSP - priority 30
1. **f1_onnx** compute f1 from onnxruntime on .onnx model on a 10k test set on Linux - priority 60
1. **f1_1k** compute f1 on quantized .dlc model on Qualcomm device DSP with a 1k test set - priority
is the mean f1 score so that quicker models are prioritized.
1. **f1_1k_f** compute f1 on floating point .dlc model on on Qualcomm device CPU with a 1k test set
- priority 10 * the mean f1 score so that quicker models are prioritized.
1. **f1_10k** compute f1 on quantized model on a 10k test set - priority = 100 * the mean f1 score
so that quicker models are prioritized.
Lower number means higher priority job and each machine will run the highest priority work first.
You can override the priority of a specific job by passing a `--proprity` parameter on the `upload.py` script or by
editing the Azure `status` table and adding a `priority` field to the JSON stored there. You can set any priority number
you want, if you specify priority 0 it will run before anything else which can be handy if you have a cool new model
that you want to bump to the top of the list.
Notice some of the above jobs can run on Linux and do not require Qualcomm device. So in order to maximize throughput on
machines that do have a Qualcomm devices you can allocate other Linux machines with no Qualcomm devices to do the other
work, namely, converting models, quantizing them, and running the `f1_onnx` test.
Folks across your team can use the `azure/upload.py` to submit jobs and let them run, or they can automate that as
shown in the `RemoteAzureBenchmarkEvaluator` in the `search.py` script.
You can use `status.py` to monitor progress or look at the Azure `status` table. Various status messages are posted
there so you can see which machine is doing what and is in what stage of the job.
Next you can go to the `notebook` page and get some pretty pictures of your Pareto Curves.

Просмотреть файл

@ -0,0 +1,22 @@
importlib-metadata!=4.7.0,<6,>=3.7.0
packaging<22.0,>=20.0
cryptography<39,>=38.0.0
psutil
tqdm
pandas
scipy
numpy
ipykernel
azure-storage-blob
azure-data-tables
azureml-mlflow
scikit-image
scikit-learn
scikit-build
opencv-contrib-python
onnx==1.11.0
onnxruntime
onnx-simplifier
pyyaml
matplotlib
git+https://github.com/microsoft/Olive.git@d880057ef36916f556080cbad2daddb3cfd1c08d#egg=olive-ai

Просмотреть файл

@ -0,0 +1,116 @@
import os
import sys
import json
import subprocess
home = os.getenv("HOME")
experiments = f"{home}/snpe/experiment"
script_dir = os.path.dirname(os.path.abspath(__file__))
map_file = os.path.join(script_dir, "map.txt")
command = f'{script_dir}/../azure/loop.sh'
def run(cmd):
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8')
stdout, stderr = p.communicate()
return (stdout.strip(), stderr.strip())
def find_screens():
screens = {}
stdout, stderr = run(["screen", "-list"])
if stderr != "":
print("screen -list failed: ")
print(stderr)
sys.exit(1)
for line in stdout.splitlines():
parts = line.strip().split('\t')
if len(parts) > 1:
id = parts[0]
parts = id.split(".")
if len(parts) == 2:
proc, device = parts
screens[device] = proc
else:
print("### skipping unrecognized screen name: {id}")
return screens
def find_devices():
devices = []
stdout, stderr = run(["adb", "devices"])
if stderr != "":
print("adb devices failed: ")
print(stderr)
sys.exit(1)
for line in stdout.splitlines():
parts = line.split('\t')
if len(parts) == 2 and parts[1] == 'device':
devices += [parts[0]]
return devices
def load_map():
map = {}
if os.path.exists(map_file):
with open(map_file, "r") as f:
map = json.load(f)
return map
def save_map(map):
with open(map_file, "w") as f:
json.dump(map, f, indent=2)
return map
def allocate_folder(map, id):
next = 1
inverse_map = {v: k for k, v in map.items()}
while True:
folder = f"{experiments}{next}"
if folder not in inverse_map:
map[id] = folder
save_map(map)
if not os.path.isdir(folder):
os.mkdir(folder)
return folder
else:
next += 1
def read_lock(folder):
lock_file = os.path.join(folder, "lock.txt")
if os.path.exists(lock_file):
return open(lock_file).read().strip()
return None
def main():
devices = find_devices()
if len(devices) == 0:
print("### Found no Qualcomm Devices using `adb devices`")
sys.exit(1)
screens = find_screens()
map = load_map()
print("# Found the following Qualcomm Devices using `adb devices`:")
for id in find_devices():
if id in map:
folder = map[id]
else:
folder = allocate_folder(map, id)
lock = read_lock(folder)
print(f"Device {id}, mapped to folder {folder}")
if id in screens:
proc = screens[id]
print(f" Screen is running: {proc}.{id}")
elif lock:
print(f" Locked by: {lock}")
else:
print(f" Please run: screen -dmS {id} {command} --device {id} --no_quantization " +
f"--cleanup_stale_pods 3600 --working {folder}")
if __name__ == '__main__':
main()

Просмотреть файл

@ -0,0 +1,9 @@
# Setup
This script contains the session setup used on the machine that is connected
to the Qualcomm boards for running N screen sessions that run the loop.sh
script for each Qualcomm board.
If you want to also cleanup stale kubernetes pods, you can add `--cleanup_stale_pods`
once you have configured `az login` and `az aks get-credentials --resource-group $resource_group --name $aks_cluster `
so that the runner script can call `cleanup_stale_pods.py`.

Просмотреть файл

@ -0,0 +1,66 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
import glob
from shutil import copyfile, rmtree
def cleanup_results(dataset, output_dir):
""" cleans up a folder containing Results* folders downloaded from device
and renames the output images to match the input image names so that
collect_metrics can work on the folder """
test_size = 0
result_dirs = os.listdir(output_dir)
for name in result_dirs:
if name.startswith('Result_'):
test_size += 1
print(f"Found {test_size} Result_* folders")
all_seg_files = sorted(glob.glob(os.path.join(dataset, '*_seg.png')))
if len(all_seg_files) < test_size:
print(f"### not enough *_seg.png files found in {dataset}")
sys.exit(1)
test_files = all_seg_files[len(all_seg_files) - test_size:]
raw_file_name = 'output.raw'
index = 0
for name in test_files:
name = os.path.basename(name).split('_')[0]
result = f"Result_{index}"
if result in result_dirs:
raw_file = os.path.join(output_dir, result, raw_file_name)
if not os.path.isfile(raw_file):
raw_file_name = os.listdir(os.path.join(output_dir, result))[0]
raw_file = os.path.join(output_dir, result, raw_file_name)
output_file = os.path.join(output_dir, name + '.raw')
print(f"{raw_file} ===> {output_file}")
copyfile(raw_file, output_file)
rmtree(os.path.join(output_dir, result))
index += 1
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Check the outputs from the device')
parser.add_argument('--input', help='Location of the original input images ' +
'(defaults to INPUT_DATASET environment variable)')
parser.add_argument('--output', '-o', help='Location of the folder containing Result* folders')
args = parser.parse_args()
dataset = args.input
if not dataset:
dataset = os.getenv("INPUT_DATASET")
if not dataset:
print("please provide --input or set your INPUT_DATASET environment vairable")
sys.exit(1)
output = args.output
if not os.path.isdir(output):
print("--output dir not found")
sys.exit(1)
cleanup_results(dataset, output)
print("Done")

Просмотреть файл

@ -0,0 +1,38 @@
#!/bin/bash
MODEL_NAME="model"
if [ "$1" == "--help" ] ; then
echo "### Usage: convert_tf.sh [model_name]"
echo "Converts the given tensorflow model to .dlc then quantizes it."
echo "Default model path is 'model/model.pb'."
exit 1
fi
if [ "$1" != "" ]; then
MODEL_NAME=$1
fi
if [ ! -f "model/${MODEL_NAME}.pb" ]; then
echo "### Model does not exist: model/${MODEL_NAME}.pb"
exit 1
fi
mkdir -p ./snpe_models
# pb 2 dlc
snpe-tensorflow-to-dlc \
-i "model/${MODEL_NAME}.pb" \
-d input_rgb "1,256,256,3" \
--out_node "logits_cls" \
-o "snpe_models/${MODEL_NAME}.dlc" \
--show_unconsumed_nodes
#--debug
# quantize
snpe-dlc-quantize \
--input_dlc "snpe_models/${MODEL_NAME}.dlc" \
--input_list "data/quant/input_list.txt" \
--output_dlc "snpe_models/${MODEL_NAME}.quant.dlc" \
--use_enhanced_quantizer

Просмотреть файл

@ -0,0 +1,110 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import cv2
import numpy as np
import glob
import os
import sys
import tqdm
from shutil import rmtree
DEVICE_WORKING_DIR = "/data/local/tmp"
TASK = os.path.basename(os.getcwd())
class DataGenerator():
def __init__(self, root, img_size, subset='quant', count=1000, transpose=None):
self.img_size = img_size
self.root = root
self.subset = subset
self.transpose = transpose
all_seg_files = sorted(glob.glob(os.path.join(self.root, '*_seg.png')))
if len(all_seg_files) == 0:
print("### no *_seg.png files found in {}".format(self.root))
sys.exit(1)
# use first 10000 images for quantization and last 10000 images for test
assert subset in ['quant', 'test']
if subset == 'quant':
self.seg_files = all_seg_files[0:1000]
elif subset == 'test':
self.seg_files = all_seg_files[len(all_seg_files) - count:]
self.img_files = [s.replace("_seg.png", ".png") for s in self.seg_files]
def __len__(self):
return len(self.img_files)
def __call__(self):
num_imgs = len(self.img_files)
assert num_imgs > 0
indices = np.arange(num_imgs)
for idx in indices:
img_file = self.img_files[idx]
img = cv2.imread(img_file)[..., ::-1] # BGR to RGB
img = cv2.resize(img, self.img_size, interpolation=cv2.INTER_LINEAR)
if self.transpose:
img = img.transpose(self.transpose)
yield os.path.basename(img_file), (img / 255).astype(np.float32)
def create_dataset(src_root, subset, shape, count, trans=None):
print(f"Creating {subset} dataset of {count} images with input shape {shape}...")
image_size = (shape[0], shape[1])
device_working_dir = f'{DEVICE_WORKING_DIR}/{TASK}'
dst_root = os.path.join(os.getcwd(), 'data', subset)
if os.path.isdir(dst_root):
rmtree(dst_root)
os.makedirs(dst_root)
data_gen = DataGenerator(src_root, image_size, subset, count, trans)
file_list = []
with tqdm.tqdm(total=len(data_gen)) as pbar:
for fname, img in data_gen():
filename = os.path.join(dst_root, fname.replace('.png', '.bin'))
file_list.append(filename)
img.tofile(filename)
pbar.update(1)
with open(os.path.join(dst_root, 'input_list.txt'), 'w') as f:
for fname in file_list:
f.write(fname)
f.write('\n')
with open(os.path.join(dst_root, 'input_list_for_device.txt'), 'w') as f:
for fname in file_list:
device_path = device_working_dir + '/data/test/' + os.path.basename(fname)
f.write(device_path)
f.write('\n')
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Create the quant and test datasets')
parser.add_argument('--input', help='Location of the original input images ' +
'(default INPUT_DATASET environment variable')
parser.add_argument('--count', '-c', type=int, help='Number of images in the test dataset folder ' +
'(default 1000)', default=1000)
parser.add_argument('--dim', '-d', type=int, help='New dimension for the images ' +
'(assumes square dimensions, default 256)', default=256)
parser.add_argument('--transpose', '-t', help="Apply image transpose of '(2, 0 1)'", action="store_true")
args = parser.parse_args()
dataset = args.input
if not dataset:
dataset = os.getenv("INPUT_DATASET")
if not dataset:
print("please provide --input or set your INPUT_DATASET environment variable")
sys.exit(1)
count = args.count
dim = args.dim
transpose = args.transpose
if transpose:
transpose = (2, 0, 1)
else:
transpose = None
create_dataset(dataset, 'quant', (dim, dim), count, transpose)
create_dataset(dataset, 'test', (dim, dim), count, transpose)

Просмотреть файл

@ -0,0 +1,8 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
def get_dlc_metrics(dlc_file):
from olive.snpe.tools.dev import get_dlc_info, get_dlc_metrics
csv_data = get_dlc_info(dlc_file)
info = get_dlc_metrics(dlc_file)
return (csv_data, info['macs'], info['parameters'])

Просмотреть файл

@ -0,0 +1,18 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
from test_snpe import download_results
from shutil import rmtree
SNPE_OUTPUT_DIR = 'snpe_output'
files = [x for x in os.listdir('data/test') if x.endswith(".bin")]
files.sort()
output_dir = SNPE_OUTPUT_DIR
if os.path.isdir(output_dir):
rmtree(output_dir)
os.makedirs(output_dir)
print("Found {} input files".format(len(files)))
download_results(files, 0, output_dir)

Просмотреть файл

@ -0,0 +1,91 @@
## Readme
This folder contains code for running models using the Qualcomm SNPE Neural Processing SDK,
including quantizing those models and running them on the Qualcomm DSP.
This folder uses http://github.com/microsoft/olive to do the actual SNPE work.
1. **Snapdragon 888 Dev Kit** - get one of these [Snapdragon 888 HDK](https://developer.qualcomm.com/hardware/snapdragon-888-hdk) boards.
1. **Download dataset**. Get the dataset from https://github.com/microsoft/FaceSynthetics.
The best way is using `azcopy`. You could put them in a datasets folder,
for example: `d:\datasets\FaceSynthetics`. Then set your `INPUT_DATASET` environment
variable pointing to this folder.
1. **Install Android NDK**. You need a working version of `adb` in your PATH.
Just download the zip file from [https://developer.android.com/ndk/downloads/](https://developer.android.com/ndk/downloads/)
and unzip it then you can set your `ANDROID_NDK_ROOT` environment variable pointing to the folder containing the
unzipped bits.
1. **Check Device USB**. Check you can run `adb shell` to connect to your Snapdragon over USB.
You may need to run `sudo usermod -aG plugdev $LOGNAME`.
1. **Install SNPE SDK on Ubuntu 18.04**.
See [SNPE Setup](https://developer.qualcomm.com/sites/default/files/docs/snpe/setup.html).
See [Neural Processing SDK Download](https://developer.qualcomm.com/downloads/qualcomm-neural-processing-sdk-ai-v1600?referrer=node/34505).
You can skip the Caffe setup, but use the `requirements.txt` pip install list, the one posted in the Qualcomm setup page
has conflicting versions. Then set your `SNPE_ROOT` environment variable pointing to the folder containing the unzipped
bits. If you plan to use Qualcomm hardware devices then set the `SNPE_ANDROID_ROOT` to the same place as `SNPE_ROOT`.
1. **Install Archai**. In your Python 3.8 Conda environment run:
```
git clone https://github.com/microsoft/archai.git
cd archai
pip install -e .[dev]
```
1. **Install required packages including Olive **
```
pushd tasks/face_segmentation/snpe
pip install -r requirements.txt
```
1. Let Olive configure SNPE
```
python -m olive.snpe.configure
```
**If you run into a protobuf inconsistency with Python 3.8 you can workaround
it by setting the folloiwng env. variable:**
```
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
```
1. **Create experiment folder**. The subsequent scripts all assume you are in a folder for running your experiment.
```
mkdir ~/experiment1
cd ~/experiment1
```
In this folder we will build the following files:
- data/test - the test image set for the device
- data/quant - the image dataset for quantizing the model
- snpe_models/model.quant.dlc - the quantized model
1. **Prepare data**. Run `python create_data.py --help`, this scripts creates data for both
quantization and test and puts it in your local experiment folder under `data/test` and
`data/quant`. For example:
```
python create_data.py --input ~/datasets/FaceSynthetics --count 1000 --dim 256
```
1. **Convert and quantize model**. You can use `test_snpe.py` to convert a .onnx model to .dlc and
quantize it. For example:
```
python test_snpe.py --quantize --model model.onnx
```
This can take about 10 minutes depending on the size of your quantization data set and the size of
your model.
1. **Run test images on device**. You can use `test_snpe.py` to test your quantized model on a
Qualcomm 888 dev board. You can find the device id using `adb devices`:
```
python test_snpe.py --device e6dc0375 --images ./data/test --model model.onnx --dlc ./snpe_models/model.quant.dlc
```
6. **Performance benchmark SNPE model**.
```
python test_snpe.py --device e6dc0375 --benchmark --images ./data/test --model model.onnx --dlc ./snpe_models/model.quant.dlc
```

Просмотреть файл

@ -0,0 +1,4 @@
conda activate snap
pushd $SNPE_ROOT
source bin/envsetup.sh -o ~/anaconda3/envs/snap/lib/python3.6/site-packages/onnx
popd

Просмотреть файл

@ -0,0 +1,97 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
from onnxruntime import InferenceSession, get_available_providers
import os
import numpy as np
import cv2
import sys
import tqdm
from create_data import DataGenerator
def test_onnx(dataset_dir, model, out_dir, test_size=1000, show=False):
os.makedirs(out_dir, exist_ok=True)
provider_list = ['CPUExecutionProvider']
if 'CUDAExecutionProvider' in get_available_providers():
print("using gpu")
provider_list = ['CUDAExecutionProvider'] + provider_list
sess = InferenceSession(model, providers=provider_list)
if len(sess._sess.inputs_meta) > 1:
raise Exception("Cannot handle models with more than one input")
if len(sess._sess.outputs_meta) > 1:
raise Exception("Cannot handle models more than one output")
input_meta = sess._sess.inputs_meta[0]
output_meta = sess._sess.outputs_meta[0]
shape = output_meta.shape
if len(shape) == 4:
shape = shape[1:] # remove match dimension.
oc, ow, oh = shape
if oh < 20:
ow, oh, oc = input_meta.shape
shape = input_meta.shape
print(f"input shape: {shape}")
print(f"output shape: {shape}")
if len(shape) == 4:
shape = shape[1:] # remove match dimension.
w, h, c = shape
transpose = (0, 1, 2)
reverse = (0, 1, 2)
if shape[0] == 3:
# then we need to transpose the input.
print("transposing to move RGB channel")
transpose = (2, 0, 1)
reverse = (1, 2, 0)
c, w, h = shape
input_name = input_meta.name
data_gen = DataGenerator(dataset_dir, (w, h), subset='test', count=test_size, transpose=transpose)
with tqdm.tqdm(total=len(data_gen)) as pbar:
for fname, img in data_gen():
inf = sess.run(None, {input_name: img[None, ...]})[0]
inf = inf.reshape(inf.shape[1:]) # remove batch dimension
inf = inf.transpose(reverse).reshape((ow, oh, -1))
basename = os.path.splitext(os.path.basename(fname))[0]
filename = os.path.join(out_dir, basename + ".raw")
inf.tofile(filename)
if show:
# debug visualize
img = img.transpose(reverse)
cls_seg = np.argmax(inf, axis=-1)
img = (255 * img).astype(np.uint8)
norm = cv2.normalize(cls_seg, None, 0, 255, cv2.NORM_MINMAX, dtype=cv2.CV_8UC1)
cls_seg_color = cv2.applyColorMap(norm, cv2.COLORMAP_JET)
canvas = np.concatenate([img[..., ::-1], cls_seg_color], axis=1)
cv2.imshow('img', canvas)
key = cv2.waitKey() & 0xFF
if key == 27:
break
pbar.update(1)
if __name__ == '__main__':
model = os.path.join('model', 'model.onnx')
output = os.path.join('onnx_outputs')
parser = argparse.ArgumentParser(description='Run an ONNX model test on a batch of input images and write ' +
'the outputs to a given folder')
parser.add_argument('--input', help='Location of the original input images ' +
'(default INPUT_DATASET environment variable')
parser.add_argument('--model', '-m', help="Name of model to test (e.g. model/model.onnx)", default=model)
parser.add_argument('--output', '-o', help="Location to write outputs (default 'onnx_outputs')", default=output)
parser.add_argument('--show', '-s', help="Show each inference image", action="store_true")
args = parser.parse_args()
dataset = args.input
if not dataset:
dataset = os.getenv("INPUT_DATASET")
if not dataset:
print("please provide --input or set your INPUT_DATASET environment vairable")
sys.exit(1)
test_onnx(dataset, args.model, args.output, show=args.show)

Просмотреть файл

@ -0,0 +1,657 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
from datetime import datetime
from pathlib import Path
import csv
import os
import sys
import time
import tqdm
import json
import numpy as np
SCRIPT_DIR = os.path.dirname(__file__)
sys.path += [os.path.join(SCRIPT_DIR, '..', 'util')]
from shell import Shell
sys.path += [os.path.join(SCRIPT_DIR, '..', 'vision')]
from collect_metrics import get_metrics
from shutil import rmtree
from onnxruntime import InferenceSession
TASK = os.path.basename(os.getcwd())
MODEL = "model"
TEST_IMAGES = os.path.join('data', 'test')
VERBOSE = False
MAX_BATCH_SIZE = 1000
DEVICE = None
# device parameters
# the /data mount on the device has 64GB available.
DEVICE_WORKING_DIR = "/data/local/tmp"
RANDOM_INPUTS = 'random_inputs'
RANDOM_INPUT_LIST = 'random_raw_list.txt'
SNPE_ROOT = None
INPUT_LIST_FILENAME = 'input_list_for_device.txt'
snpe_target_arch = None
def set_device(device):
global DEVICE
DEVICE = device
shell = Shell()
shell.run(os.getcwd(), adb("root"))
def get_device():
global DEVICE
if DEVICE:
return DEVICE
else:
raise Exception("Please specify the '--device' to use")
def _get_input_layout(shape):
# snpe-onnx-to-dlc supported input layouts are:
# NCHW, NHWC, NFC, NCF, NTF, TNF, NF, NC, F, NONTRIVIAL
# N = Batch, C = Channels, H = Height, W = Width, F = Feature, T = Time
if shape[0] == 3:
# then the RGB channel is first, so we are NCHW
return 'NCHW'
elif shape[-1] == 3:
return 'NHWC'
else:
raise Exception(f"Cannot figure out input layout from shape: {shape}")
def onnx_to_dlc(model, model_dir):
sess = InferenceSession(model, providers=['CPUExecutionProvider'])
if len(sess._sess.inputs_meta) > 1:
raise Exception("Cannot handle models with more than one input")
if len(sess._sess.outputs_meta) > 1:
raise Exception("Cannot handle models more than one output")
input_meta = sess._sess.inputs_meta[0]
output_meta = sess._sess.outputs_meta[0]
filename = os.path.basename(model)
basename = os.path.splitext(filename)[0]
print(f"==> Converting model {model} to .dlc...")
shape = input_meta.shape
if len(shape) == 4:
shape = shape[1:] # trim off batch dimension
layout = _get_input_layout(shape)
input_shape = ",".join([str(i) for i in input_meta.shape])
output_dlc = f"{model_dir}/{basename}.dlc"
# snpe-onnx-to-dlc changes the model input to NHWC.
dlc_shape = shape if layout == 'NHWC' else [shape[1], shape[2], shape[0]]
command = "snpe-onnx-to-dlc " + \
f"-i \"{model}\" " + \
f"-d {input_meta.name} \"{input_shape}\" " + \
f"--input_layout {input_meta.name} {layout} " + \
f"--out_node \"{output_meta.name}\" " + \
f"-o \"{output_dlc}\" "
print(command)
shell = Shell()
rc = shell.run(os.getcwd(), command, True)
if 'Conversion completed successfully' not in rc:
raise Exception(rc)
# the DLC model undoes the NCHW and results in a .dlc model that takes NHWC input.
return [output_dlc, dlc_shape]
def create_snpe_config(model_file, output_dir=None):
sess = InferenceSession(model_file, providers=['CPUExecutionProvider'])
if len(sess._sess.inputs_meta) > 1:
raise Exception("Cannot handle models with more than one input")
if len(sess._sess.outputs_meta) > 1:
raise Exception("Cannot handle models more than one output")
input_meta = sess._sess.inputs_meta[0]
output_meta = sess._sess.outputs_meta[0]
shape = input_meta.shape
if len(shape) == 4:
shape = shape[1:] # trim off batch dimension
layout = _get_input_layout(shape)
# snpe-onnx-to-dlc changes the model input to NHWC
output_shape = output_meta.shape[1:] # stip off batch dimension
output_shape = output_shape if layout == 'NHWC' else [output_shape[1], output_shape[2], output_shape[0]]
config = {
"io_config": {
"input_names": [input_meta.name],
"input_shapes": [input_meta.shape],
"output_names": [output_meta.name],
"output_shapes": [output_shape]
},
"convert_options": {
"input_layouts": [layout]
},
"quantize_options": {
"use_enhanced_quantizer": True
}
}
if output_dir is not None:
config_file = os.path.join(output_dir, 'snpe_config.json')
with open(config_file, 'w', encoding='utf-8') as f:
json.dump(config, f, indent=2)
return config
def convert_onnx_to_dlc(onnx_model, snpe_output_file):
from olive.passes import SNPEConversion
config = create_snpe_config(onnx_model.model_path, os.path.dirname(snpe_output_file))
convert_options = config['io_config']
convert_options["input_layouts"] = config['convert_options']["input_layouts"]
snpe_conversion = SNPEConversion(convert_options, disable_search=True,)
snpe_model = snpe_conversion.run(onnx_model, snpe_output_file)
assert Path(snpe_model.model_path).is_file()
dlc_model_path = snpe_model.model_path
input_shape = snpe_model.io_config["input_shapes"][0]
output_shape = snpe_model.io_config["output_shapes"][0]
return dlc_model_path, input_shape, output_shape
def convert_model(model, model_dir):
""" Converts the given model from .onnx form to .dlc and returns
the path to the .dlc file, the input shape, and an optional error message if something went wrong."""
if not os.path.isfile(model):
print(f"model to convert not found in {model}")
sys.exit(1)
# make sure we run the downloaded model and not some old model
# left over from a previous run.
if os.path.isdir(model_dir):
rmtree(model_dir)
os.makedirs(model_dir)
from olive.model import ONNXModel
filename = os.path.basename(model)
basename, ext = os.path.splitext(filename)
if ext != ".onnx":
print("convert_model was not provided with a valid .onnx model")
sys.exit(1)
try:
onnx_model = ONNXModel(model, basename)
snpe_output_file = f"{model_dir}/model.dlc"
model, input_shape, output_shape = convert_onnx_to_dlc(onnx_model, snpe_output_file)
return [model, input_shape[1:], output_shape[1:], None]
except Exception as ex:
return [None, None, str(ex)]
def create_quant_dataloader(data_dir):
from olive.snpe import SNPEProcessedDataLoader
return SNPEProcessedDataLoader(data_dir, input_list_file="input_list.txt")
def quantize_model(model, onnx_model, snpe_model_dir):
""" Returns tuple containing the quantized model file and optional error message """
from olive.model import SNPEModel
from olive.passes import SNPEQuantization
snpe_model_dir = os.path.realpath(snpe_model_dir) # Olive requires the full path
basename = os.path.splitext(os.path.basename(model))[0]
output_model = os.path.join(snpe_model_dir, f"{basename}.quant.dlc")
full_dlc_path = os.path.join(snpe_model_dir, f"{basename}.dlc")
data_dir = os.path.join('data', 'quant')
config = create_snpe_config(onnx_model, snpe_model_dir)
if config is None:
return [None, "### SNPE Configuration file could not be loaded"]
snpe_model = SNPEModel(model_path=full_dlc_path, name=basename, **config["io_config"])
quant_options = {
"use_enhanced_quantizer": True,
"data_dir": data_dir,
"dataloader_func": create_quant_dataloader
}
# tbd: what is "enable_htp": True
snpe_quantization = SNPEQuantization(quant_options, disable_search=True)
try:
snpe_quantized_model = snpe_quantization.run(snpe_model, output_model)
except Exception as ex:
error = None
for line in str(ex):
if '[ERROR]' in line:
error = line
if not error:
error = str(ex)
return [None, error]
if not Path(snpe_quantized_model.model_path).is_file():
return [None, "### Model conversion failed"]
return [snpe_quantized_model.model_path, None]
def adb(cmd):
return f"adb -s {get_device()} {cmd}"
def download_results(input_images, start, output_dir):
shell = Shell()
result = shell.run(os.getcwd(), adb(f"shell ls {DEVICE_WORKING_DIR}/{TASK}/{MODEL}/output"), False)
if not os.path.isdir(output_dir):
os.makedirs(output_dir)
# Now download results from output folder full of 'Result_nnn' folders, copying the file to
# down to match with the input image name, so the input image name might be 000000.bin, and
# the downloaded file might be named 'Result_0/logits_0:1.raw' and this will become
# the downloaded file named `000000.raw` in the 'snpe_output' folder. This makes it easier
# to match the the output with the input later when we are analyzing the results.
output_filename = None
index = start
for name in input_images:
line = f"Result_{index}"
if line in result:
raw_file = os.path.splitext(name)[0] + '.raw'
index += 1
if not output_filename:
cmd = adb(f"shell ls {DEVICE_WORKING_DIR}/{TASK}/{MODEL}/output/{line}/")
device_result = shell.run(os.getcwd(), cmd, False)
output_filename = device_result.strip()
print(f"{line}/{output_filename} ===> {raw_file}")
device_result = f"{DEVICE_WORKING_DIR}/{TASK}/{MODEL}/output/{line}/{output_filename}"
rc = shell.run(output_dir, adb(f"pull {device_result} {raw_file}"), False)
if "error:" in rc:
print("### error downloading results: " + rc)
sys.exit(1)
def get_target_arch(snpe_root):
global SNPE_ROOT
SNPE_ROOT = snpe_root
if not os.path.isdir(snpe_root):
print("SNPE_ROOT folder {} not found".format(snpe_root))
sys.exit(1)
for name in os.listdir(os.path.join(snpe_root, 'lib')):
if name.startswith('aarch64-android'):
print(f"Using SNPE_TARGET_ARCH {name}")
return name
print("SNPE_ROOT folder {} missing aarch64-android-*".format(snpe_root))
sys.exit(1)
def clear_images():
shell = Shell()
target = f"{DEVICE_WORKING_DIR}/{TASK}/data/test"
shell.run(os.getcwd(), adb(f"shell \"rm -rf {target}\""))
def copy_file(shell, folder, filename, target):
rc = shell.run(folder, adb(f"push {filename} {target}"), False)
if "error:" in rc:
print(f"### Error copying file {filename}: {rc}")
sys.exit(1)
def setup_images(folder, batch):
shell = Shell()
target = f"{DEVICE_WORKING_DIR}/{TASK}/data/test"
shell.run(os.getcwd(), adb(f"shell \"mkdir -p {target}\""))
# since we are doing a batch we have to generate the input_list_for_device.txt file.
list_file = INPUT_LIST_FILENAME
with open(list_file, 'w', encoding='utf-8') as f:
for line in batch:
f.write(f"{target}/{line}\n")
copy_file(shell, os.getcwd(), list_file, target)
# pushing the whole dir often fails for some reason, so we push individual files with a retry loop
with tqdm.tqdm(total=len(batch)) as pbar:
for file in batch:
pbar.update(1)
retries = 5
while retries > 0:
try:
copy_file(shell, folder, file, target)
break
except Exception as e:
retries -= 1
print(f"Error {e}, retrying in 1 second ...")
time.sleep(1)
if retries == 0:
raise Exception(f"Cannot copy file {file} to {target}")
def get_setup():
global snpe_target_arch
if not snpe_target_arch:
print("snpe_target_arch is not set")
sys.exit(1)
lib_path = f"{DEVICE_WORKING_DIR}/dsp/lib;/system/lib/rfsa/adsp;/system/vendor/lib/rfsa/adsp;/dsp"
setup = f"export SNPE_TARGET_ARCH={snpe_target_arch} && " + \
f"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{DEVICE_WORKING_DIR}/{snpe_target_arch}/lib && " + \
f"export PATH=$PATH:{DEVICE_WORKING_DIR}/{snpe_target_arch}/bin && " + \
f"export ADSP_LIBRARY_PATH='{lib_path}' && " + \
f"cd {DEVICE_WORKING_DIR}/{TASK}/{MODEL}"
print("Using environment:")
print(setup)
return setup
def upload_first_image(dataset):
target = f"{DEVICE_WORKING_DIR}/{TASK}/data/test"
shell = Shell()
shell.run(os.getcwd(), adb(f"shell \"mkdir -p {target}\""))
files = os.listdir(dataset)
files.sort()
filename = files[0]
print(f"Uploading image {filename}...")
shell.run(dataset, adb(f"push {filename} {target}"), VERBOSE)
return os.path.join(target, filename)
def generate_random_inputs(count, shape):
input_list_path = os.path.join(RANDOM_INPUTS, RANDOM_INPUT_LIST)
meta = os.path.join(RANDOM_INPUTS, 'meta.json')
if os.path.isfile(meta):
with open(meta, 'r', encoding='utf-8') as f:
info = json.load(f)
if info['count'] == count and info['shape'] == str(shape):
# then we can reuse these random inputs.
return input_list_path
if os.path.isdir(RANDOM_INPUTS):
rmtree(RANDOM_INPUTS)
os.makedirs(RANDOM_INPUTS)
with open(meta, 'w', encoding='utf-8') as f:
info = {'count': count, 'shape': str(shape)}
json.dump(info, f, indent=2)
random_data_dim = np.product(shape)
with open(input_list_path, 'w', encoding='utf-8') as input_list:
for i in range(count):
rand_raw = np.random.uniform(-1.0, +1.0, random_data_dim).astype(np.float32)
raw_filepath = os.path.join(RANDOM_INPUTS, 'random_input_' + str(i) + '.raw')
input_list.write(raw_filepath + "\n")
with open(raw_filepath, 'wb') as fid:
fid.write(rand_raw)
return input_list_path
def get_memlog_usage(benchmark_dir):
# find the memory usage
# Uptime: 1738234338 Realtime: 1738234338
for i in range(1, 6):
memlog = os.path.join(benchmark_dir, 'results', 'latest_results', 'mem', 'DSP_ub_tf8', f'Run{i}', 'MemLog.txt')
if os.path.isfile(memlog):
try:
for line in open(memlog, 'r', encoding='utf-8').readlines():
if 'Realtime:' in line:
parts = line.strip().split(' ')
try:
mem = int(parts[-1])
if mem != 0:
return [mem, memlog]
except:
pass
except:
pass
return [0, '']
def read_total_inference_avg(csvfile):
col_index = 11
with open(csvfile, 'r', encoding='utf-8') as file:
for data in csv.reader(file):
for i in range(len(data)):
col = data[i]
if col.startswith('DSP_ub_tf8_timing'):
col_index = i
break
if 'Total Inference Time' in data:
return int(data[col_index])
return 0
def run_throughput(model, duration):
if not model:
print("### --run needs the --model parameter")
sys.exit(1)
shell = Shell()
use_dsp = "--use_dsp" if 'quant' in model else ''
setup = get_setup()
dataset = os.path.join('data', 'test')
filename = upload_first_image(dataset)
print(f"Running throughput test for {duration} seconds...")
rc = shell.run(
os.getcwd(),
adb(f"shell \"{setup} &&" +
f"snpe-throughput-net-run --container ./{model} {use_dsp} --duration {duration} " +
"--iterations 1 --perf_profile high_performance " +
f"--input_raw {filename} \""), VERBOSE)
lines = rc.split('\n')
for out in lines:
if "Total throughput:" in out:
print(out)
def compute_results(shape, num_classes, output_folder):
if not os.path.isdir(output_folder):
print("Folder not found: '{output_folder}'")
return
dataset = os.getenv("INPUT_DATASET")
if not os.path.isdir(dataset):
print("Please set your INPUT_DATASET environment variable")
return
return get_metrics(shape, False, dataset, output_folder, num_classes)
def run_batches(onnx_model, dlc_model, images_dir, workspace_dir):
from olive.snpe import (
SNPESessionOptions,
SNPEInferenceSession,
SNPEProcessedDataLoader
)
input_dir = os.path.realpath(images_dir)
snpe_model_dir = os.path.dirname(dlc_model)
output_dir = os.path.join(workspace_dir, 'snpe-output')
if os.path.isdir(output_dir):
rmtree(output_dir)
full_dlc_path = os.path.realpath(dlc_model)
basename = os.path.splitext(os.path.basename(dlc_model))[0]
options = SNPESessionOptions(
android_target=get_device(),
device="dsp" if 'quant' in basename else "cpu",
workspace=workspace_dir,
accumulate_outputs=True
)
config = create_snpe_config(onnx_model, snpe_model_dir)
if config is None:
return [None, "### SNPE Configuration file could not be loaded"]
io_config = config["io_config"]
# More than 1000 test images can fill up the device and then we run out of memory.
# So we run the inference session in batches here.
data_loader = SNPEProcessedDataLoader(input_dir, input_list_file='input_list.txt', batch_size=100)
output_folder = ''
latencies = []
for i in range(data_loader.num_batches):
print(f"Running SNPE inference batch {i} of {data_loader.num_batches}")
batch_dir, batch_input_list, _ = data_loader.get_batch(i)
session = SNPEInferenceSession(full_dlc_path, io_config, options)
results = session.net_run(batch_input_list, batch_dir)
output_folder = results['output_dir']
latencies += [results['latencies']]
return output_folder, latencies
def run_benchmark(onnx_model, dlc_model, images_dir, duration, workspace_dir):
from olive.snpe import (
SNPESessionOptions,
SNPEInferenceSession,
SNPEProcessedDataLoader
)
input_dir = os.path.realpath(images_dir)
_ = os.path.join(input_dir, 'input_list.txt')
snpe_model_dir = os.path.dirname(dlc_model)
output_dir = os.path.join(workspace_dir, 'snpe-output')
if os.path.isdir(output_dir):
rmtree(output_dir)
full_dlc_path = os.path.realpath(dlc_model)
basename = os.path.splitext(os.path.basename(dlc_model))[0]
# This mirrors what the snpe_bench.py script is doing.
options = SNPESessionOptions(
android_target=get_device(),
device="dsp" if 'quant' in basename else "cpu",
extra_args="--perf_profile high_performance --profiling_level basic",
workspace=workspace_dir,
accumulate_outputs=True
)
config = create_snpe_config(onnx_model, snpe_model_dir)
if config is None:
return [None, "### SNPE Configuration file could not be loaded"]
data_loader = SNPEProcessedDataLoader(images_dir, input_list_file='input_list.txt', batch_size=50)
io_config = config["io_config"]
output_folder = ''
latencies = []
print("Running SNPE inference benchmark")
batch_dir, batch_input_list, _ = data_loader.get_batch(0)
session = SNPEInferenceSession(full_dlc_path, io_config, options)
results = session.net_run(batch_input_list, batch_dir)
output_folder = results['output_dir']
latencies += [results['latencies']]
return (output_folder, latencies)
def parse_command_line():
parser = argparse.ArgumentParser(description='Run a model on the QUALCOMM DSP using adb and SNPE SDK to quantize ' +
'the model')
parser.add_argument('--device', '-d', help='The Android device id (as returned by adb devices)', default=None)
parser.add_argument('--images', '-i', help='Location of local test image dataset (created with create_data.py)')
parser.add_argument('--model', '-m', help='The path to the ONNX model to test')
parser.add_argument('--dlc', help='The specific .dlc model to test, if not provided it will be converted from ' +
'--model and stored in an snpe_models folder')
parser.add_argument('--quantize', '-q', help='Quantize the given onnx or dlc model', action="store_true")
parser.add_argument('--benchmark', '-b', help='Run a benchmark on the given model', action="store_true")
parser.add_argument('--throughput', '-t', help='Run performance test of the given model', action="store_true")
parser.add_argument('--duration', type=int, help='Duration of throughput and benchmark tests (default 10 seconds)',
default=10)
parser.add_argument('--verbose', '-v', help='Show all output (default false)', action="store_true")
args = parser.parse_args()
if not args.model:
print("Please provide an onnx model as input")
return None
ndk = os.getenv("ANDROID_NDK_ROOT")
if not ndk:
print("you must have a ANDROID_NDK_ROOT installed, see the readme.md")
return None
args.ndk = ndk
snpe = os.getenv("SNPE_ANDROID_ROOT")
if not snpe:
print("please set your SNPE_ANDROID_ROOT environment variable, see readme.md")
return None
snpe = os.getenv("SNPE_ROOT")
if not snpe:
print("please set your SNPE_ROOT environment variable, see readme.md")
return None
args.snpe = snpe
return args
def main():
global VERBOSE
args = parse_command_line()
if args is None:
return 1
VERBOSE = args.verbose
if args.device:
set_device(args.device)
model = args.model
model_dir = "snpe_models"
if args.dlc:
dlc_model = args.dlc
else:
dlc_model, shape, output_shape, error = convert_model(args.model, model_dir)
if error:
print(error)
return 1
config = create_snpe_config(args.model, '.')
if args.quantize:
quantized_model, error = quantize_model(model, model, model_dir)
if error is not None:
print(error)
return 1
if args.throughput:
run_throughput(model, args.duration)
return 0
if args.benchmark:
start = datetime.now()
image_path = os.path.realpath(args.images)
output_folder, latencies = run_benchmark(model, dlc_model, image_path, args.duration, '.')
end = datetime.now()
print(f"benchmark completed in {end-start} seconds, results in {output_folder}")
for m in latencies:
print(f"total_inference_time={m['total_inference_time']}")
return 0
if args.images:
start = datetime.now()
output_folder, latencies = run_batches(model, dlc_model, args.images, '.')
end = datetime.now()
print(f"batch completed in {end-start} seconds, results in {output_folder}")
for m in latencies:
print(f"total_inference_time={m['total_inference_time']}")
output_shape = config['io_config']['output_shapes'][0]
compute_results(output_shape, output_folder)
if __name__ == '__main__':
sys.exit(main())

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше