日常·工作笔记

以下是工作中常用总结,有需要自取,请勿传播,谢谢

进入已起的docker:

[zhangkaiwang@m7-model-gpu16 ~]$ docker exec -it 2b94296c5411 /bin/bash

移动所有文件到上一级目录

mv * ../

运行命令:

python test.py –gpus 0 –input_dir data/rsod/images/test –output_dir output_file –load_model ./v_dir/weights/basketball/model_best.pth

文件移动命令:

docker cp 2b94296c5411:/home/autodet/output_file/info_frame_test.zip ./

自定义分辨率命令:

python test.py –gpus 0 –input_dir src/video/CLIP2/c0003 –output_dir test_c0003 –load_model ./v_dir/weights/basketball/model_best.pth –input_w 1920 –input_h 1080

视频编码转换:

ffmpeg -i demo1.avi -c:a aac -b:a 192k -ac 2 out.mp4

auto保存输出:

Last login: Wed Feb 12 12:55:42 on ttys003
[oh-my-zsh] Random theme ‘/Users/zhangyiji/.oh-my-zsh/themes/wedisagree.zsh-theme’ loaded…
/Users/zhangyiji/.zshrc:119: unmatched ”
[~] ssh zhangkaiwang@m7-model-gpu15 12:56:36
zhangkaiwang@m7-model-gpu15’s password:
Last login: Wed Feb 12 12:57:15 2020 from 172.27.143.248
(base) [zhangkaiwang@m7-model-gpu15 ~]$ ls
2020-02-12 00:40:00 INFO train_test.py:26 PID:1] predictor running…
2020-02-12 00:40:00.385840: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 5, 6
2020-02-12 00:40:00.386068: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-02-12 00:40:00.386094: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 5 6
2020-02-12 00:40:00.386116: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 5: N Y
2020-02-12 00:40:00.386138: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 6: Y N
2020-02-12 00:40:00.386867: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10470 MB memory) -> physical GPU (device: 5, name: GeForce GTX 1080 Ti, pci bus id: 0000:89:00.0, compute capability: 6.1)
2020-02-12 00:40:00.387260: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:1 with 10470 MB memory) -> physical GPU (device: 6, name: GeForce GTX 1080 Ti, pci bus id: 0000:8a:00.0, compute capability: 6.1)
imagenet
2020-02-12 00:40:15 INFO train_test.py:26 PID:1] [1.1070883735798704, 0.5148173674150305]
2020-02-12 00:40:15 INFO train_test.py:26 PID:1] save breakpoint to: records/x_ray/fix_200211_111422/1/predictor_bp.pk
2020-02-12 00:40:15 INFO train_test.py:26 PID:1] 346
2020-02-12 00:40:15 INFO train_test.py:26 PID:1] predictor end.
2020-02-12 00:40:15 INFO train_test.py:26 PID:1] predictor’s runtime: 15 secs.
2020-02-12 00:40:15 INFO train_test.py:26 PID:1] {‘conv_val_performance’: [1.1102006535625393, 0.5127498278077268], ‘fast_swa_performance’: [1.1070883735798704, 0.5148173674150305], ‘auto_lr_1’: ‘[3e-06, 0.012614786]’, ‘auto_lr_2’: ‘[3e-06, 1.0969858e-05]’, ‘time’: ‘swa using time: 15706.8102’}
2020-02-12 00:40:15 INFO train_test.py:26 PID:1] swa_train/train:0 end.
2020-02-12 00:40:15 INFO train_test.py:26 PID:1] swa_train/train:0’s runtime: 16938 secs.
2020-02-12 00:40:15 INFO train_test.py:26 PID:1] Saved model config export to: records/x_ray/fix_200211_111422/saved_model/deploy_config.json
2020-02-12 00:40:15 INFO train_test.py:26 PID:1] save breakpoint to: records/x_ray/fix_200211_111422/swa_train_train_0_bp.pk
2020-02-12 00:40:15 INFO train_test.py:26 PID:1] all jobs done!
2020-02-12 00:40:15 INFO train_test.py:97 PID:1] train()’s runtime: 48352.6707 sec.
(docker_py36) [zhangkaiwang@m7-model-gpu15 cv_research_inner_use]$

json格式:

‘oiltank_406.jpg’: [{‘xmin’: 536.3613891601562, ‘ymin’: 360.69873046875, ‘xmax’: 662.4075317382812, ‘ymax’: 487.2774963378906, ‘category’: ‘oiltank’, ‘confidence’: 0.8713931441307068}, {‘xmin’: 242.92503356933594, ‘ymin’: 372.2471923828125, ‘xmax’: 367.0032958984375, ‘ymax’: 493.3931884765625, ‘category’: ‘oiltank’, ‘confidence’: 0.8484389781951904}, {‘xmin’: 97.60460662841797, ‘ymin’: 372.05560302734375, ‘xmax’: 216.3622589111328, ‘ymax’: 494.38494873046875, ‘category’: ‘oiltank’, ‘confidence’: 0.8470964431762695}, {‘xmin’: 410.4715270996094, ‘ymin’: 367.5977783203125, ‘xmax’: 534.41357421875, ‘ymax’: 492.6016845703125, ‘category’: ‘oiltank’, ‘confidence’: 0.8220490217208862}, {‘xmin’: 118.74742889404297, ‘ymin’: 266.47796630859375, ‘xmax’: 222.73153686523438, ‘ymax’: 358.1685791015625, ‘category’: ‘oiltank’, ‘confidence’: 0.8163228034973145}, {‘xmin’: 258.8901672363281, ‘ymin’: 261.9883117675781, ‘xmax’: 357.21331787109375, ‘ymax’: 354.7013854980469, ‘category’: ‘oiltank’, ‘confidence’: 0.8042650818824768}, {‘xmin’: 415.4309997558594, ‘ymin’: 507.3085021972656, ‘xmax’: 520.0567626953125, ‘ymax’: 612.5038452148438, ‘category’: ‘oiltank’, ‘confidence’: 0.731714129447937}, {‘xmin’: 807.4695434570312, ‘ymin’: 525.2620239257812, ‘xmax’: 892.322021484375, ‘ymax’: 612.2249145507812, ‘category’: ‘oiltank’, ‘confidence’: 0.694177508354187}, {‘xmin’: 107.8218002319336, ‘ymin’: 532.2503051757812, ‘xmax’: 199.4886474609375, ‘ymax’: 619.289794921875, ‘category’: ‘oiltank’, ‘confidence’: 0.5470021367073059}, {‘xmin’: 279.95184326171875, ‘ymin’: 542.8613891601562, ‘xmax’: 349.50653076171875, ‘ymax’: 621.11181640625, ‘category’: ‘oiltank’, ‘confidence’: 0.39349809288978577}, {‘xmin’: 578.4956665039062, ‘ymin’: 535.8005981445312, ‘xmax’: 653.469970703125, ‘ymax’: 611.1575317382812, ‘category’: ‘oiltank’, ‘confidence’: 0.3663710951805115}]}

run docker:

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import _init_paths
import cv2
from test import *
import json
if __name__ == ‘__main__’:
r=test_docker()
with open(‘results.json’, ‘w’) as result_file:
json.dump(r, result_file)
#r=test_api(datadir=’015-nwpu-vhr-10/data’,mode=2,preexp_id=’nwputest2′)
#r=test_api(mode=3,preexp_id=’nwputest2′)
#image=cv2.imread(‘../input_file/404.jpg’)
#r=test_api(mode=1,image=image,preexp_id=’nwputest2′)
#test(exp_id=’basketball’,mode=’tv’,input_mp4=’./cba2.MP4′,output_mp4=’./cba2_det.MP4′)
print(r)

此条目发表在ALL, 随笔分类目录,贴了, 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注