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
classes= 12 | |
train = /home/user/darknet/drug_detect/drug_train.txt | |
valid = /home/user/darknet/drug_detect/drug_val.txt | |
names = /home/user/darknet/drug_detect/drug_voc.names | |
backup = /home/user/darknet/drug_detect/backup/ |
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
import xml.etree.ElementTree as ET | |
import pickle | |
import os | |
from os import listdir, getcwd | |
from os.path import join | |
# 這裡改[類別名稱],drug的項目有12個類別 | |
classes = ["Binin-U", "Concor5mg", "Depyretin", "Diphenidol", "ligilin", "Lopedin", "Madopar125mg", "Madopar250mg", "Medicon-A", "Requip025", "spironolactone", "Treceton"] | |
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
Binin-U | |
Concor5mg | |
Depyretin | |
Diphenidol | |
ligilin | |
Lopedin | |
Madopar125mg | |
Madopar250mg | |
Medicon-A | |
Requip025 |
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
name: "AlexNet" | |
layer { | |
name: "data" | |
type: "Data" | |
top: "data" | |
top: "label" | |
include { | |
phase: TRAIN | |
} | |
transform_param { |
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
net: "train_val.prototxt" | |
test_iter: 1000 | |
test_interval: 1000 | |
base_lr: 0.01 | |
lr_policy: "step" | |
gamma: 0.1 | |
stepsize: 10000 | |
display: 20 | |
# max_iter: 450000 | |
max_iter: 50200 |
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
name: "AlexNet" | |
layer { | |
name: "data" | |
type: "Input" | |
top: "data" | |
input_param { shape: { dim: 1 dim: 3 dim: 135 dim: 135 } } | |
} | |
layer { | |
name: "conv1" | |
type: "Convolution" |
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
@echo off | |
SET DIRD="C:\Users\user\caffe-windows" | |
FOR /L %%G IN (0,1,11) DO FOR %%i IN (%%G\*.*) DO %DIRD%\Build\x64\Release\classification.exe deploy.prototxt caffe_alexnet_train_iter_30000.caffemodel mean.binaryproto label_12.txt %%i | |
pause |
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
@echo off | |
SET FILE="caffe_alexnet_train_iter_30000.solverstate" | |
SET DIRD="C:\Users\user\caffe-windows" | |
IF EXIST %FILE% ( | |
REM Resuming | |
%DIRD%\Build\x64\Release\caffe.exe train --solver=solver.prototxt --snapshot=%FILE% -gpu 0 | |
) ELSE ( | |
REM Training |
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
@echo off | |
SET DIRD="C:\Users\user\caffe-windows" | |
%DIRD%\Build\x64\Release\compute_image_mean.exe train_all_lmdb mean.binaryproto | |
pause |
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
@echo off | |
SET DIRC="test_all_lmdb" | |
IF EXIST %DIRC% ( | |
RMDIR /S /Q %DIRC% | |
) | |
SET DIRD="C:\Users\user\caffe-windows" | |
%DIRD%\Build\x64\Release\convert_imageset.exe %DIRD%\dataset\ test.txt %DIRC% --gray=false --shuffle=false --resize_width=180 --resize_height=135 --check_size=false --encode_type=jpg |