-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
7 changed files
with
181 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM oneflowinc/oneflow:0.9.1.dev20240203-cuda11.8 | ||
|
||
RUN python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple | ||
|
||
COPY requirements.txt /tmp/requirements.txt | ||
RUN python3 -m pip install --no-cache-dir -r /tmp/requirements.txt | ||
|
||
RUN python3 -m pip install --pre oneflow -f https://oneflow-staging.oss-cn-beijing.aliyuncs.com/branch/master/cu118 | ||
|
||
WORKDIR /workspace | ||
|
||
RUN rm /tmp/requirements.txt |
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,14 @@ | ||
## cv_cls_test.sh | ||
|
||
### 介绍 | ||
`cv_cls_test.sh` 是一个用于处理 `cv/classification` 目录下子目录的 Bash 脚本。根据用户提供的参数,该脚本可以对所有子目录、随机选取的子目录或前 n 个子目录进行操作。 | ||
|
||
### 脚本功能 | ||
1. **复制子目录**:将指定的子目录内容复制到 `/workspace/temp_model` 目录下。 | ||
2. **进入工作目录**:进入 `/workspace/temp_model` 目录。 | ||
3. **运行脚本**:执行该目录下的脚本(`infer.sh`缺省脚本)。 | ||
|
||
### 使用方法 | ||
|
||
```bash | ||
./cv_cls_test.sh {all|random|n} {infer.sh|train.sh} |
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,5 @@ | ||
#!/bin/bash | ||
IMAGE_NAME="oneflow_comodels_test:0.1" | ||
|
||
docker build -t $IMAGE_NAME . | ||
|
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,58 @@ | ||
#!/bin/bash | ||
|
||
EXEC=${2:-infer.sh} | ||
SUB_DIR_PATH="/workspace/CoModels/cv/classification" | ||
WORKSPACE="/workspace/temp_model" | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "Usage: $0 {all|random|n}" | ||
exit 1 | ||
fi | ||
|
||
option="$1" | ||
|
||
subdirs=($(find "$SUB_DIR_PATH" -mindepth 1 -maxdepth 1 -type d)) | ||
|
||
process_subdir() { | ||
local dir="$1" | ||
|
||
rm -rf "$WORKSPACE" | ||
mkdir -p "$WORKSPACE" | ||
|
||
cp -rL "$dir"/* "$WORKSPACE" | ||
|
||
cd "$WORKSPACE" | ||
|
||
if [ -f "./$EXEC" ]; then | ||
bash ./$EXEC | ||
else | ||
echo "$EXEC not found in $WORKSPACE" | ||
fi | ||
|
||
cd - > /dev/null | ||
} | ||
|
||
case "$option" in | ||
"all") | ||
for dir in "${subdirs[@]}"; do | ||
process_subdir "$dir" | ||
done | ||
;; | ||
"random") | ||
random_index=$((RANDOM % ${#subdirs[@]})) | ||
process_subdir "${subdirs[$random_index]}" | ||
;; | ||
[0-9]*) | ||
n="$option" | ||
for ((i=0; i<n && i<${#subdirs[@]}; i++)); do | ||
process_subdir "${subdirs[$i]}" | ||
done | ||
;; | ||
*) | ||
echo "Invalid option: $option" | ||
echo "Usage: $0 {all|random|n}" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "All operations completed." |
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 @@ | ||
#!/bin/bash | ||
|
||
EXEC=${2:-infer.sh} | ||
SUB_DIR_PATH="/workspace/CoModels/cv/detection" | ||
WORKSPACE="/workspace/temp_model" | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "Usage: $0 {all|random|n}" | ||
exit 1 | ||
fi | ||
|
||
option="$1" | ||
|
||
subdirs=($(find "$SUB_DIR_PATH" -mindepth 1 -maxdepth 1 -type d)) | ||
|
||
process_subdir() { | ||
local dir="$1" | ||
|
||
rm -rf "$WORKSPACE" | ||
mkdir -p "$WORKSPACE" | ||
|
||
cp -rL "$dir"/* "$WORKSPACE" | ||
cp -rL "$SUB_DIR_PATH/retinanet_resnet50_fpn" "$WORKSPACE" | ||
cp -rL "$SUB_DIR_PATH/fcos_resnet50_fpn" "$WORKSPACE" | ||
|
||
cd "$WORKSPACE" | ||
|
||
if [ -f "./$EXEC" ]; then | ||
bash ./$EXEC | ||
else | ||
echo "$EXEC not found in $WORKSPACE" | ||
fi | ||
|
||
cd - > /dev/null | ||
} | ||
|
||
case "$option" in | ||
"all") | ||
for dir in "${subdirs[@]}"; do | ||
process_subdir "$dir" | ||
done | ||
;; | ||
"random") | ||
random_index=$((RANDOM % ${#subdirs[@]})) | ||
process_subdir "${subdirs[$random_index]}" | ||
;; | ||
[0-9]*) | ||
n="$option" | ||
for ((i=0; i<n && i<${#subdirs[@]}; i++)); do | ||
process_subdir "${subdirs[$i]}" | ||
done | ||
;; | ||
*) | ||
echo "Invalid option: $option" | ||
echo "Usage: $0 {all|random|n}" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "All operations completed." |
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,21 @@ | ||
#!/bin/bash | ||
|
||
current_dir=$(dirname "$(realpath "$0")") | ||
parent_dir=$(dirname "$current_dir") | ||
|
||
docker run -it --rm --runtime=nvidia --privileged \ | ||
--network host --gpus=all \ | ||
--ipc=host \ | ||
-v /data:/data \ | ||
-v /data/dataset/coco:/dataset/mscoco_2017 \ | ||
-v $parent_dir:/workspace/CoModels \ | ||
-v $parent_dir/cached_models:/root/.oneflow \ | ||
-w /workspace \ | ||
oneflow_comodels_test:0.1 \ | ||
bash | ||
#docker.io/oneflowinc/onediff:cu121 \ | ||
#comodels_test:latest \ | ||
#registry.cn-beijing.aliyuncs.com/oneflow/oneflow:nightly-cuda11.8 \ | ||
#triton_trt_llm:latest \ | ||
#docker.io/tensorrt_llm/release:latest \ | ||
|
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,11 @@ | ||
click == 8.1.7 | ||
omegaconf == 2.1.0 | ||
matplotlib | ||
Pillow | ||
opencv-python | ||
scikit-learn | ||
scipy==1.7.1 | ||
yacs | ||
flowvision | ||
termcolor | ||
pycocotools |