This repository has been archived by the owner on May 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from daita-technologies/develop
✨Release 1.1 `ai-tools`
- Loading branch information
Showing
651 changed files
with
26,220 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM python:3.8.13-slim | ||
|
||
# Install necessary build tools | ||
RUN apt-get update -y \ | ||
&& apt-get install -y --no-install-recommends git build-essential ffmpeg libsm6 libxext6 \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Change default directory | ||
WORKDIR /app | ||
|
||
# Install dependencies | ||
COPY requirements-cpu.txt . | ||
RUN pip install --no-cache-dir \ | ||
-r requirements-cpu.txt \ | ||
--find-links=https://download.pytorch.org/whl/torch_stable.html \ | ||
--find-links=https://download.openmmlab.com/mmcv/dist/cpu/torch1.7.0/index.html | ||
|
||
# Set environment variable | ||
ENV PYTHONPATH="$PYTHONPATH:/app" | ||
|
||
# Copy model's checkpoint | ||
COPY checkpoints/segformer.b0.1024x1024.city.160k.pth checkpoints/segformer.b0.1024x1024.city.160k.pth | ||
|
||
# Install dependencies | ||
COPY mmseg mmseg | ||
COPY setup.py setup.py | ||
|
||
# Copy necessary files to docker image | ||
COPY local_configs local_configs | ||
COPY run.py run.py | ||
|
||
ENTRYPOINT ["python", "run.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# dataset settings | ||
dataset_type = "ADE20KDataset" | ||
data_root = "data/ade/ADEChallengeData2016" | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True | ||
) | ||
crop_size = (512, 512) | ||
train_pipeline = [ | ||
dict(type="LoadImageFromFile"), | ||
dict(type="LoadAnnotations", reduce_zero_label=True), | ||
dict(type="Resize", img_scale=(2048, 512), ratio_range=(0.5, 2.0)), | ||
dict(type="RandomCrop", crop_size=crop_size, cat_max_ratio=0.75), | ||
dict(type="RandomFlip", prob=0.5), | ||
dict(type="PhotoMetricDistortion"), | ||
dict(type="Normalize", **img_norm_cfg), | ||
dict(type="Pad", size=crop_size, pad_val=0, seg_pad_val=255), | ||
dict(type="DefaultFormatBundle"), | ||
dict(type="Collect", keys=["img", "gt_semantic_seg"]), | ||
] | ||
test_pipeline = [ | ||
dict(type="LoadImageFromFile"), | ||
dict( | ||
type="MultiScaleFlipAug", | ||
img_scale=(2048, 512), | ||
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75], | ||
flip=False, | ||
transforms=[ | ||
dict(type="Resize", keep_ratio=True), | ||
dict(type="RandomFlip"), | ||
dict(type="Normalize", **img_norm_cfg), | ||
dict(type="ImageToTensor", keys=["img"]), | ||
dict(type="Collect", keys=["img"]), | ||
], | ||
), | ||
] | ||
data = dict( | ||
samples_per_gpu=4, | ||
workers_per_gpu=4, | ||
train=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir="images/training", | ||
ann_dir="annotations/training", | ||
pipeline=train_pipeline, | ||
), | ||
val=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir="images/validation", | ||
ann_dir="annotations/validation", | ||
pipeline=test_pipeline, | ||
), | ||
test=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir="images/validation", | ||
ann_dir="annotations/validation", | ||
pipeline=test_pipeline, | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# dataset settings | ||
dataset_type = "ChaseDB1Dataset" | ||
data_root = "data/CHASE_DB1" | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True | ||
) | ||
img_scale = (960, 999) | ||
crop_size = (128, 128) | ||
train_pipeline = [ | ||
dict(type="LoadImageFromFile"), | ||
dict(type="LoadAnnotations"), | ||
dict(type="Resize", img_scale=img_scale, ratio_range=(0.5, 2.0)), | ||
dict(type="RandomCrop", crop_size=crop_size, cat_max_ratio=0.75), | ||
dict(type="RandomFlip", prob=0.5), | ||
dict(type="PhotoMetricDistortion"), | ||
dict(type="Normalize", **img_norm_cfg), | ||
dict(type="Pad", size=crop_size, pad_val=0, seg_pad_val=255), | ||
dict(type="DefaultFormatBundle"), | ||
dict(type="Collect", keys=["img", "gt_semantic_seg"]), | ||
] | ||
test_pipeline = [ | ||
dict(type="LoadImageFromFile"), | ||
dict( | ||
type="MultiScaleFlipAug", | ||
img_scale=img_scale, | ||
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0], | ||
flip=False, | ||
transforms=[ | ||
dict(type="Resize", keep_ratio=True), | ||
dict(type="RandomFlip"), | ||
dict(type="Normalize", **img_norm_cfg), | ||
dict(type="ImageToTensor", keys=["img"]), | ||
dict(type="Collect", keys=["img"]), | ||
], | ||
), | ||
] | ||
|
||
data = dict( | ||
samples_per_gpu=4, | ||
workers_per_gpu=4, | ||
train=dict( | ||
type="RepeatDataset", | ||
times=40000, | ||
dataset=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir="images/training", | ||
ann_dir="annotations/training", | ||
pipeline=train_pipeline, | ||
), | ||
), | ||
val=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir="images/validation", | ||
ann_dir="annotations/validation", | ||
pipeline=test_pipeline, | ||
), | ||
test=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir="images/validation", | ||
ann_dir="annotations/validation", | ||
pipeline=test_pipeline, | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# dataset settings | ||
dataset_type = "CityscapesDataset" | ||
data_root = "data/cityscapes/" | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True | ||
) | ||
crop_size = (512, 1024) | ||
train_pipeline = [ | ||
dict(type="LoadImageFromFile"), | ||
dict(type="LoadAnnotations"), | ||
dict(type="Resize", img_scale=(2048, 1024), ratio_range=(0.5, 2.0)), | ||
dict(type="RandomCrop", crop_size=crop_size, cat_max_ratio=0.75), | ||
dict(type="RandomFlip", prob=0.5), | ||
dict(type="PhotoMetricDistortion"), | ||
dict(type="Normalize", **img_norm_cfg), | ||
dict(type="Pad", size=crop_size, pad_val=0, seg_pad_val=255), | ||
dict(type="DefaultFormatBundle"), | ||
dict(type="Collect", keys=["img", "gt_semantic_seg"]), | ||
] | ||
test_pipeline = [ | ||
dict(type="LoadImageFromFile"), | ||
dict( | ||
type="MultiScaleFlipAug", | ||
img_scale=(2048, 1024), | ||
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75], | ||
flip=False, | ||
transforms=[ | ||
dict(type="Resize", keep_ratio=True), | ||
dict(type="RandomFlip"), | ||
dict(type="Normalize", **img_norm_cfg), | ||
dict(type="ImageToTensor", keys=["img"]), | ||
dict(type="Collect", keys=["img"]), | ||
], | ||
), | ||
] | ||
data = dict( | ||
samples_per_gpu=2, | ||
workers_per_gpu=2, | ||
train=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir="leftImg8bit/train", | ||
ann_dir="gtFine/train", | ||
pipeline=train_pipeline, | ||
), | ||
val=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir="leftImg8bit/val", | ||
ann_dir="gtFine/val", | ||
pipeline=test_pipeline, | ||
), | ||
test=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir="leftImg8bit/val", | ||
ann_dir="gtFine/val", | ||
pipeline=test_pipeline, | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
_base_ = "./cityscapes.py" | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True | ||
) | ||
crop_size = (768, 768) | ||
train_pipeline = [ | ||
dict(type="LoadImageFromFile"), | ||
dict(type="LoadAnnotations"), | ||
dict(type="Resize", img_scale=(2049, 1025), ratio_range=(0.5, 2.0)), | ||
dict(type="RandomCrop", crop_size=crop_size, cat_max_ratio=0.75), | ||
dict(type="RandomFlip", prob=0.5), | ||
dict(type="PhotoMetricDistortion"), | ||
dict(type="Normalize", **img_norm_cfg), | ||
dict(type="Pad", size=crop_size, pad_val=0, seg_pad_val=255), | ||
dict(type="DefaultFormatBundle"), | ||
dict(type="Collect", keys=["img", "gt_semantic_seg"]), | ||
] | ||
test_pipeline = [ | ||
dict(type="LoadImageFromFile"), | ||
dict( | ||
type="MultiScaleFlipAug", | ||
img_scale=(2049, 1025), | ||
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75], | ||
flip=False, | ||
transforms=[ | ||
dict(type="Resize", keep_ratio=True), | ||
dict(type="RandomFlip"), | ||
dict(type="Normalize", **img_norm_cfg), | ||
dict(type="ImageToTensor", keys=["img"]), | ||
dict(type="Collect", keys=["img"]), | ||
], | ||
), | ||
] | ||
data = dict( | ||
train=dict(pipeline=train_pipeline), | ||
val=dict(pipeline=test_pipeline), | ||
test=dict(pipeline=test_pipeline), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
_base_ = "./cityscapes.py" | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True | ||
) | ||
crop_size = (769, 769) | ||
train_pipeline = [ | ||
dict(type="LoadImageFromFile"), | ||
dict(type="LoadAnnotations"), | ||
dict(type="Resize", img_scale=(2049, 1025), ratio_range=(0.5, 2.0)), | ||
dict(type="RandomCrop", crop_size=crop_size, cat_max_ratio=0.75), | ||
dict(type="RandomFlip", prob=0.5), | ||
dict(type="PhotoMetricDistortion"), | ||
dict(type="Normalize", **img_norm_cfg), | ||
dict(type="Pad", size=crop_size, pad_val=0, seg_pad_val=255), | ||
dict(type="DefaultFormatBundle"), | ||
dict(type="Collect", keys=["img", "gt_semantic_seg"]), | ||
] | ||
test_pipeline = [ | ||
dict(type="LoadImageFromFile"), | ||
dict( | ||
type="MultiScaleFlipAug", | ||
img_scale=(2049, 1025), | ||
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75], | ||
flip=False, | ||
transforms=[ | ||
dict(type="Resize", keep_ratio=True), | ||
dict(type="RandomFlip"), | ||
dict(type="Normalize", **img_norm_cfg), | ||
dict(type="ImageToTensor", keys=["img"]), | ||
dict(type="Collect", keys=["img"]), | ||
], | ||
), | ||
] | ||
data = dict( | ||
train=dict(pipeline=train_pipeline), | ||
val=dict(pipeline=test_pipeline), | ||
test=dict(pipeline=test_pipeline), | ||
) |
Oops, something went wrong.