메뉴 건너뛰기

웹 시프_model_20241120

2024.11.20 14:23

setUID 조회 수:26

https://drive.google.com/file/d/1PgvjpEId1mlX7i4MqNfsJeoiB1rJfxJ3/view?usp=drive_link

https://drive.google.com/file/d/16nCigXxDjH7KKyZxJ-KvE-Zlv79ZO-mz/view?usp=drive_link

https://drive.google.com/file/d/1mLB3UZ0hgVPXguPRedHtb1UWAy2nlUyF/view?usp=drive_link

 

!gdown https://drive.google.com/uc?id=1PgvjpEId1mlX7i4MqNfsJeoiB1rJfxJ3 -O ./models/colorization_release_v2.caffemodel

 

 

## 모델 로드
import cv2
import numpy as np
import matplotlib.pyplot as plt
 
proto = './models/colorization_deploy_v2.prototxt'
weight = './models/colorization_release_v2.caffemodel'
 
pts_in_hull = np.load('./models/pts_in_hull.npy')
pts_in_hull = pts_in_hull.transpose().reshape(2, 313, 1, 1).astype(np.float32)
 
net = cv2.dnn.readNetFromCaffe(proto, weight)
 
net.getLayer(net.getLayerId('class8_ab')).blobs = [pts_in_hull]
net.getLayer(net.getLayerId('conv8_313_rh')).blobs = [np.full((1,313), 2.606, np.float32)]
위로