gseps inference server code

This commit is contained in:
ssung 2023-09-01 14:54:57 +09:00
parent f670f846fd
commit 5536ec473d
7 changed files with 28 additions and 10 deletions

View File

@ -3,5 +3,5 @@
"ftp_port": 21, "ftp_port": 21,
"ftp_id": "sdt", "ftp_id": "sdt",
"ftp_pw": "251327", "ftp_pw": "251327",
"ftp_root_dir": "/home/sdt/Workspace/gseps/rabbitmq_test/inference_result/" "ftp_root_dir": "/home/sdt/Workspace/gseps_inference/inference_result/"
} }

View File

@ -19,10 +19,10 @@
"area_thresh": 0.1, "area_thresh": 0.1,
"device": "cuda" "device": "cuda"
}, },
"model_checkpoints": "/home/sdt/Workspace/gseps/rabbitmq_test/weights/sam_vit_h_4b8939.pth", "model_checkpoints": "/home/sdt/Workspace/gseps_inference/weights/sam_vit_h_4b8939.pth",
"remote_server_ip": "25.15.14.31", "remote_server_ip": "25.15.14.31",
"remote_server_id": "sdt", "remote_server_id": "sdt",
"remote_server_pw": "251327", "remote_server_pw": "251327",
"copied_image_path_from_remote_server": "/home/sdt/Workspace/gseps/rabbitmq_test/image_bucket", "copied_image_path_from_remote_server": "/home/sdt/Workspace/gseps_inference/image_bucket",
"inference_result_path": "/home/sdt/Workspace/gseps/rabbitmq_test/inference_result/" "inference_result_path": "/home/sdt/Workspace/gseps_inference/inference_result/"
} }

View File

@ -4,7 +4,7 @@ from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer from pyftpdlib.servers import FTPServer
# config # config
with open('./config/ftp_config.json', 'r') as f: with open('/home/sdt/Workspace/gseps_inference/config/ftp_config.json', 'r') as f:
info = json.load(f) info = json.load(f)
# 서버 설정 # 서버 설정

View File

@ -4,6 +4,8 @@ Description=FTP Server
[Service] [Service]
ExecStart=/home/sdt/miniconda3/bin/python /home/sdt/Workspace/gseps/ftp_server.py ExecStart=/home/sdt/miniconda3/bin/python /home/sdt/Workspace/gseps/ftp_server.py
Restart=on-failure Restart=on-failure
Group=sdt
User=sdt
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -18,7 +18,7 @@ from segment_anything import sam_model_registry, SamAutomaticMaskGenerator
############################################### ###############################################
# Config # # Config #
############################################### ###############################################
with open('./config/inference_config.json', 'r') as f: with open('/home/sdt/Workspace/gseps_inference/config/inference_config.json', 'r') as f:
info = json.load(f) info = json.load(f)

View File

@ -4,6 +4,8 @@ Description=inference processor
[Service] [Service]
ExecStart=/home/sdt/miniconda3/bin/python /home/sdt/Workspace/gseps/rabbitmq_test/inference.py ExecStart=/home/sdt/miniconda3/bin/python /home/sdt/Workspace/gseps/rabbitmq_test/inference.py
Restart=on-failure Restart=on-failure
Group=sdt
User=sdt
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -1,6 +1,20 @@
#!/bin/bash #!/bin/bash
sudo cp ftp_server.service /etc/systemd/system/
sudo cp inference_processor.service /etc/systemd/system/ if [ -f '/etc/systemd/system/ftp_server.service' ]; then
sudo systemctl disable ftp_server.service
sudo systemctl stop ftp_server.service
sudo rm -rf /etc/systemd/system/ftp_server.service
fi
if [ -f '/etc/systemd/system/inference_processor.service' ]; then
sudo systemctl disable inference_processor.service
sudo systemctl stop inference_processor.service
sudo rm -rf /etc/systemd/system/inference_processor.service
fi
sudo cp /home/sdt/Workspace/gseps/ftp_server.service /etc/systemd/system/
sudo cp /home/sdt/Workspace/gseps/inference_processor.service /etc/systemd/system/
sudo systemctl daemon-reload sudo systemctl daemon-reload
sudo systemctl enable ftp_server.service sudo systemctl enable ftp_server.service
sudo systemctl enable inference_processor.service sudo systemctl enable inference_processor.service