-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5cc0b0
commit fbba332
Showing
19 changed files
with
256 additions
and
65 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 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 |
---|---|---|
|
@@ -6,6 +6,7 @@ tmps/ | |
temp/ | ||
temps/ | ||
resource/ | ||
projects/ | ||
|
||
|
||
# Vuepress/Vitepress | ||
|
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 @@ | ||
# =============== Color Print =============== | ||
$DEFAULT = [char]27 + '[0m' | ||
$RED = [char]27 + '[00;31m' | ||
$GREEN = [char]27 + '[00;32m' | ||
$YELLOW = [char]27 + '[00;33m' | ||
$CYAN = [char]27 + '[00;36m' | ||
|
||
function print_base { param($color, $type, $message) Write-Host -NoNewline "$color- [$type] $message"; Write-Host $DEFAULT } | ||
function print_info { param($message) print_base $CYAN "INFO" $message } | ||
function print_tip { param($message) print_base $YELLOW "TIP" $message } | ||
function print_success { param($message) print_base $GREEN "SUCCESS" $message } | ||
function print_warning { param($message) print_base $YELLOW "WARNING" $message } | ||
function print_error { param($message) print_base $RED "ERROR" $message } | ||
|
||
function run_script { | ||
param($scriptPath) | ||
if (-not (Test-Path $scriptPath -PathType Leaf)) { | ||
Write-Host "$scriptPath not found" | ||
exit 1 | ||
} | ||
. $scriptPath # 指定 powershell 执行脚本 | ||
} | ||
|
||
$variablesCustomPath = "scripts/variables.custom.ps1" | ||
$variablesDefaultPath = "scripts/variables.ps1" | ||
|
||
if (Test-Path $variablesCustomPath -PathType Leaf) { | ||
run_script $variablesCustomPath | ||
print_success "Loaded custom variables: '$variablesCustomPath'" | ||
} | ||
elseif (Test-Path $variablesDefaultPath -PathType Leaf) { | ||
run_script $variablesDefaultPath | ||
print_success "Loaded default variables: '$variablesDefaultPath'" | ||
} | ||
else { | ||
Write-Host "'$variablesCustomPath' or '$variablesDefaultPath' not found" | ||
exit 1 | ||
} |
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,68 @@ | ||
# 启动 PowerShell:打开 PowerShell 控制台。可以通过在Windows搜索框中键入“PowerShell”并选择相应的选项来启动。 | ||
|
||
# 设置执行策略(可选):如果您的系统的执行策略不允许运行脚本,您可能需要先更改执行策略。可以通过在管理员权限下打开的 PowerShell 中运行以下命令来更改执行策略: | ||
|
||
# powershell | ||
# 复制代码 | ||
# Set-ExecutionPolicy RemoteSigned | ||
# 这将允许运行本地的、来自 Internet 的已签名脚本,但不会执行未签名的本地脚本。 | ||
|
||
# Check if scripts\base.ps1 exists | ||
if (-not (Test-Path "scripts\base.ps1")) { | ||
Write-Host "scripts\base.ps1 not found" | ||
exit 1 | ||
} | ||
|
||
. "scripts\base.ps1" | ||
|
||
# Check if ENV_PATH is set | ||
if (-not $script:ENV_PATH) { | ||
print_error "ENV_PATH is not set. Please set it in 'scripts\variables.ps1'" | ||
exit 1 | ||
} | ||
|
||
$script:ENV_PATH = "$script:ENV_PATH.conda" | ||
|
||
# Check if ENV_PATH directory exists | ||
if (-not (Test-Path $script:ENV_PATH -PathType Container)) { | ||
$DEFAULT_PYTHON_VERSION = 3.10 | ||
if (-not $script:CUSTOM_PYTHON_VERSION) { | ||
$ENV_PYTHON_VERSION = $DEFAULT_PYTHON_VERSION | ||
} else { | ||
$ENV_PYTHON_VERSION = $script:CUSTOM_PYTHON_VERSION | ||
} | ||
conda create -p $script:ENV_PATH -y python=$ENV_PYTHON_VERSION | ||
print_success "Create Python environment in '$script:ENV_PATH'" | ||
} else { | ||
print_info "Conda environment '$script:ENV_PATH' already exists." | ||
} | ||
|
||
conda activate $script:ENV_PATH | ||
|
||
# 该安装命令参考 https://pytorch.org/get-started/locally/ | ||
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121 | ||
pip install -r projects/yolov5/requirements.txt | ||
pip install -r requirements/requirements.train.txt | ||
|
||
conda deactivate | ||
|
||
function print_activate_env_message { | ||
Write-Host "" | ||
print_info "Run command below to activate the environment:" | ||
Write-Host "" | ||
Write-Host "source ~/.$(Split-Path -Leaf $PROFILE)" | ||
Write-Host "conda activate $script:ENV_PATH" | ||
Write-Host "" | ||
print_info "Then run command below to deactivate the environment:" | ||
Write-Host "" | ||
Write-Host "source ~/.$(Split-Path -Leaf $PROFILE)" | ||
Write-Host "conda deactivate" | ||
Write-Host "" | ||
} | ||
print_activate_env_message | ||
|
||
# cd .\project\deep-object-detect-track\ | ||
# conda activate .\.env\deep-object-detect-track.conda\ | ||
# python .\export.py --weights "C:\Users\29650\project\deep-object-detect-track\.cache\yolov5\yolov5s.pt" --data data/coco128.yaml --simplify --include onnx openvino engine --device 0 | ||
# python .\export.py --weights "C:\Users\29650\project\deep-object-detect-track\.cache\yolov5\yolov5s.pt" --data data/coco128.yaml --include onnx openvino engine --device 0 | ||
# python .\export.py --weights "C:\Users\29650\project\deep-object-detect-track\.cache\yolov5\yolov5s.pt" --data data/coco128.yaml --include engine --device 0 |
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,22 @@ | ||
if [ ! -f "scripts/base.sh" ]; then | ||
echo "scripts/base.sh not found" | ||
exit 1 | ||
fi | ||
source scripts/base.sh | ||
|
||
tag_name=v1.0.0 | ||
base_url=https://github.com/HenryZhuHR/deep-object-detect-track/releases/download/${tag_name} | ||
|
||
|
||
weights_dir=$CACHE_DIR/yolov5 | ||
[ ! -d ${weights_dir} ] && mkdir -p ${weights_dir} | ||
|
||
wget -c ${base_url}/coco.yaml -P ${weights_dir} | ||
wget -c ${base_url}/yolov5s.onnx -P ${weights_dir} | ||
|
||
|
||
ov_dir=${weights_dir}/yolov5s_openvino_model | ||
[ ! -d ${ov_dir} ] && mkdir -p ${ov_dir} | ||
|
||
wget -c ${base_url}/yolov5s.bin -P ${ov_dir} | ||
wget -c ${base_url}/yolov5s.xml -P ${ov_dir} |
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
Oops, something went wrong.