93 lines
1.7 KiB
Python
93 lines
1.7 KiB
Python
# DeepLabV3+ Package
|
|
"""
|
|
DeepLabV3+ Semantic Segmentation Model for Water Body Detection
|
|
|
|
사용 예시:
|
|
# 모델 생성
|
|
from app.AI_modules.DeepLabV3 import create_model
|
|
model = create_model(image_size=128)
|
|
|
|
# 데이터 로드
|
|
from app.AI_modules.DeepLabV3 import load_data
|
|
train_ds = load_data('/path/to/images/', trim=[100, 600])
|
|
|
|
# 학습
|
|
from app.AI_modules.DeepLabV3 import train
|
|
model, history = train(image_path='/path/to/images/')
|
|
|
|
# 저장된 모델 로드
|
|
from app.AI_modules.DeepLabV3 import load_model
|
|
model = load_model('DeepLabV3-Plus.h5')
|
|
"""
|
|
|
|
# Config
|
|
from .config import (
|
|
IMAGE_SIZE,
|
|
BATCH_SIZE,
|
|
LEARNING_RATE,
|
|
EPOCHS,
|
|
IMAGE_PATH,
|
|
MODEL_SAVE_PATH,
|
|
)
|
|
|
|
# Data Loading
|
|
from .data_loader_original import (
|
|
load_image,
|
|
load_images,
|
|
load_data,
|
|
create_dataset_from_paths,
|
|
)
|
|
|
|
# Layers
|
|
from .layers import (
|
|
ConvBlock,
|
|
AtrousSpatialPyramidPooling,
|
|
)
|
|
|
|
# Model
|
|
from .model import (
|
|
create_model,
|
|
load_model,
|
|
)
|
|
|
|
# Utils
|
|
from .utils import (
|
|
show_images,
|
|
show_single_prediction,
|
|
prediction_to_base64,
|
|
mask_to_binary,
|
|
calculate_iou,
|
|
)
|
|
|
|
# Training
|
|
from .train import train
|
|
|
|
__all__ = [
|
|
# Config
|
|
'IMAGE_SIZE',
|
|
'BATCH_SIZE',
|
|
'LEARNING_RATE',
|
|
'EPOCHS',
|
|
'IMAGE_PATH',
|
|
'MODEL_SAVE_PATH',
|
|
# Data Loading
|
|
'load_image',
|
|
'load_images',
|
|
'load_data',
|
|
'create_dataset_from_paths',
|
|
# Layers
|
|
'ConvBlock',
|
|
'AtrousSpatialPyramidPooling',
|
|
# Model
|
|
'create_model',
|
|
'load_model',
|
|
# Utils
|
|
'show_images',
|
|
'show_single_prediction',
|
|
'prediction_to_base64',
|
|
'mask_to_binary',
|
|
'calculate_iou',
|
|
# Training
|
|
'train',
|
|
]
|