Skip to content

Commit

Permalink
新增环境相关的脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryZhuHR committed Dec 24, 2023
1 parent d9b6940 commit 1da2caf
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 8 deletions.
11 changes: 11 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@


```bash
conda create -n yolov5 python=3.10 -y
```

```bash
python3 -m pip install --upgrade pip
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu121
pip3 install -r requirements.txt
```
2 changes: 1 addition & 1 deletion convert-voc-yolov5.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_args():
args.add_argument(
"--raw_data_path",
type=str,
default="resource/shipdata",
default="resource/ships",
help="raw data path",
)
return args.parse_args()
Expand Down
10 changes: 10 additions & 0 deletions export-onnx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import onnxruntime as ort
import numpy as np

ort_session = ort.InferenceSession("alexnet.onnx")

outputs = ort_session.run(
None,
{"actual_input_1": np.random.randn(10, 3, 224, 224).astype(np.float32)},
)
print(outputs[0])
8 changes: 6 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ PyYAML>=5.3.1
requests>=2.23.0
scipy>=1.4.1
thop>=0.1.1 # FLOPs computation
torch>=1.8.0 # see https://pytorch.org/get-started/locally (recommended)
torchvision>=0.9.0
# torch>=1.8.0 # see https://pytorch.org/get-started/locally (recommended)
# torchvision>=0.9.0
torch --index-url https://download.pytorch.org/whl/cu118
torchvision --index-url https://download.pytorch.org/whl/cu118
tqdm>=4.64.0
ultralytics>=8.0.147
# protobuf<=3.20.1 # https://github.com/ultralytics/yolov5/issues/8012
Expand Down Expand Up @@ -47,3 +49,5 @@ setuptools>=65.5.1 # Snyk vulnerability fix
# mss # screenshots
# albumentations>=1.0.3
# pycocotools>=2.0.6 # COCO mAP


2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def main(opt, callbacks=Callbacks()):
# Checks
if RANK in {-1, 0}:
print_args(vars(opt))
check_git_status()
# check_git_status()
check_requirements(ROOT / 'requirements.txt')

# Resume (from specified or most recent last.pt)
Expand Down
4 changes: 2 additions & 2 deletions train.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
python3 train.py \
--cfg models/yolov5s.yaml --weights weights/yolov5s.pt \
--data resource/shipdata-yolov5/data.yaml \
--batch-size 16 --epochs 100 \
--data resource/ships-yolov5/data.yaml \
--batch-size 32 --epochs 30 \
--device 0

2 changes: 1 addition & 1 deletion transmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
scp -P $IP_N4090_SERVER_PORT -r zhr@$IP_ANTIS_PUBLIC_IP:~/project/yolov5 .

# send to server
scp -P $IP_N3080_SERVER_PORT -r ../yolov5 zhr@$IP_ANTIS_PUBLIC_IP:~/project/yolov5
scp -P $IP_N3080_SERVER_PORT -r ../yolov5 zhr@$IP_ANTIS_PUBLIC_IP:~/project/yolov5/
2 changes: 1 addition & 1 deletion utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def check_dataset(data, autodownload=True):
dt = f'({round(time.time() - t, 1)}s)'
s = f"success ✅ {dt}, saved to {colorstr('bold', DATASETS_DIR)}" if r in (0, None) else f'failure {dt} ❌'
LOGGER.info(f'Dataset download {s}')
check_font('Arial.ttf' if is_ascii(data['names']) else 'Arial.Unicode.ttf', progress=True) # download fonts
# check_font('Arial.ttf' if is_ascii(data['names']) else 'Arial.Unicode.ttf', progress=True) # TODO: download fonts
return data # dictionary


Expand Down

0 comments on commit 1da2caf

Please sign in to comment.