Package: siq
SIQ - super-resolution image quantificationdeep perceptual resampling and super-resolution for (medical) imaginginstall by calling (within the source directory):python setup.py installor install viapip install siqwhat this will dofacilitates:creating training and testing data for deep networksgenerating and testing perceptual losses in 2D and 3Dgeneral training and inference functions for deep networksintuitive weighting of multiple lossesanisotropic super-resolutionevaluation strategies for the abovefirst time setupimportantspyt1wantspyt1w.get_data(force_download=True)# import siq     # FIXME - for later# siq.get_data( force_download=True )NOTE:get_datahas aforce_downloadoption to make sure the latest
package data is installed.example processingimportosimportsiqimportglobimportantsfns=glob.glob(os.path.expanduser("~/.antspyt1w/2*T1w*gz"))importtensorflowastfofn=os.path.expanduser("~/code/DPR/models/dsr3d_2up_64_256_6_3_v0.0zzz.h5")ifos.path.exists(ofn):print("existing model")# should always initialize with pre-trained modelmdl=tf.keras.models.load_model(ofn,compile=False)else:print("default model - initialized with random weights")mdl=siq.default_dbpn([2,2,2])# should match ratio of high to low size patchesmyoutprefix='/tmp/XXX'training_path=siq.train(mdl,fns[0:3],fns[0:3],output_prefix=myoutprefix,target_patch_size=[32,32,32],target_patch_size_low=[16,16,16],n_test=2,learning_rate=5e-05,feature_layer=6,feature=2,tv=0.1,max_iterations=2,verbose=True)training_path.to_csv(myoutprefix+"_training.csv")image=ants.image_read(fns[0])image=ants.resample_image(image,[48,48,48])# downsample for speed in testingtest=siq.inference(image,mdl)see also: the training scripts intests.todonumpy read/writetest/fix 2Dyour compute environmentexportTF_ENABLE_ONEDNN_OPTS=1# for CPUtotal_cpu_cores=$(nproc)number_sockets=$(($(grep"^physical id"/proc/cpuinfo|awk'{print $4}'|sort-un|tail-1)+1))number_cpu_cores=$(((total_cpu_cores/2)/number_sockets))echo"number of CPU cores per socket:$number_cpu_cores";echo"number of socket:$number_sockets";echo"Physical cores:"egrep'^core id'/proc/cpuinfo|sort-u|wc-lecho"Logical cores:"egrep'^processor'/proc/cpuinfo|sort-u|wc-lecho"Physical cpus (separate chips):"egrep'^physical id'/proc/cpuinfo|sort-u|wc-lto publish a releaserm -r -f build/ antspymm.egg-info/ dist/
python3 setup.py sdist bdist_wheel
python3 -m twine upload -u username -p password  dist/*notes on cpu environment# dd=/home/ubuntu/miniconda3/condabin/conda
# conda update -n base -c defaults conda
# conda init bash
# conda create -n ai3 python=3.9
# conda activate ai3 
# pip3 install --upgrade pip
py=python3 # "sudo /opt/parallelcluster/pyenv/versions/3.7.10/envs/awsbatch_virtualenv/bin/python3.7"

$py -m pip install --upgrade pip

# python3.7 -m pip uninstall tensorflow antspynet dipy patsy tensorboard tensorflow-probability -y
$py -m pip install nibabel PyNomaly scipy 
$py -m pip install antspyx 
$py -m pip install dipy 
$py -m pip install antspyt1w 
$py -m pip install antspymm 
$py -m pip install antspynet
$py -m pip install siq
$py -m pip uninstall tensorflow -y
$py -m pip install intel-tensorflow # -avx512==2.9.1
$py -m pip install tensorflow_probability
$py -m pip install keras