qstat -F gpus,gputype,mem_total -q gpuqlogin -pe gpu-titanx 1| """ | |
| Author: Kiyoon Kim ([email protected]) | |
| Since torchvision 0.13 (PyTorch 1.12), the new `weights` parameter is introduced and the original `pretrained` parameter is now deprecated. | |
| It supports more pretrained weights but it is more difficult to find the right one. | |
| This script provides a backward compatible but supporting new version in ease, using strings. | |
| """ | |
| from __future__ import annotations | |
| from typing import Callable, get_type_hints, get_args | |
| from enum import Enum | |
| from packaging import version | 
| #!/usr/bin/env python3 | |
| # Requirements | |
| # pip3 install pandas | |
| # sudo apt install xclip | |
| import pandas as pd | |
| import numpy as np | |
| import argparse | 
| #!/bin/bash | |
| # Make this script executable by | |
| # chmod +x Python_gui_executable_conda.sh | |
| # On Mac, | |
| # go to properties of the file, choose open with, Terminal.app in Utilities folder. | |
| # On Ubuntu you need to make another file. | |
| # Follow the `ubuntu.desktop` script. | 
| #!/bin/bash | |
| # If you don't have conda installed, run these in advance. | |
| #wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh | |
| #bash Miniconda3-latest-Linux-x86_64.sh | |
| # Run the script using `source epic_viewer_setup.sh`. | |
| if [[ "${BASH_SOURCE[0]}" == "${0}" ]] | |
| then | 
| #!/usr/bin/env bash | |
| # Start NGROK in background | |
| echo "⚡️ Starting ngrok" | |
| ngrok http 8080 > /dev/null & | |
| # Wait for ngrok to be available | |
| while ! nc -z localhost 4040; do | |
| sleep 1/5 # wait Ngrok to be available | |
| done | 
| #!/bin/bash | |
| # If you don't have conda installed, run these in advance. | |
| #wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh | |
| #bash Miniconda3-latest-Linux-x86_64.sh | |
| # Run the script using `source epic_viewer_setup.sh`. | |
| if [[ "${BASH_SOURCE[0]}" == "${0}" ]] | |
| then | 
| # https://community.usa.canon.com/t5/Camera-Software/When-available-Canon-EOS-Utility-for-Linux-Ubuntu/td-p/314449 | |
| # https://www.crackedthecode.co/how-to-use-your-dslr-as-a-webcam-in-linux/ | |
| pkill -9 gvfs-gphoto2-volume-monitor | |
| pkill -9 gvfsd-gphoto2 | |
| # CPU | |
| gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0 | |
| # GPU | 
| # https://stackoverflow.com/questions/9112979/pipe-stdout-and-stderr-to-two-different-processes-in-shell-script | |
| # Executes the command, prints the errors, and save the stdout and stderr as separate files. | |
| save_stdouterr_print_err () { | |
| commandstr="$1" | |
| stdoutpath="$2" | |
| stderrpath="$3" | |
| if [[ $# -lt 4 ]] | |
| then | |
| SSH_EVAL='eval' | |
| else | 
| ### get the first node name as master address | |
| ### e.g. master(aislab-[2-5],gnoded1) == aislab-2 | |
| import argparse | |
| def get_parser(): | |
| parser = argparse.ArgumentParser(description="Extract master node name from Slurm node list", | |
| formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |
| parser.add_argument("nodelist", help="Slurm nodelist") | |
| return parser |