Skip to content

Instantly share code, notes, and snippets.

View AlbertoCasasOrtiz's full-sized avatar
🏠
Working from home

Alberto AlbertoCasasOrtiz

🏠
Working from home
View GitHub Profile
#!/bin/bash
# Exit when an error happens instead of continue.
set -e
# Default values for flags.
DEBUG_TYPE="Release"
NUM_JOBS=4
MOCO="on"
CORE_BRANCH="main"
#!/bin/bash
# Exit when an error happens instead of continue.
set -e
# Default values for flags.
DEBUG_TYPE="Release"
NUM_JOBS=4
MOCO="on"
CORE_BRANCH="main"
#Requires -RunAsAdministrator
param (
[switch]$s=$false,
[switch]$h=$false,
[string]$d="Release",
[string]$c="main",
[int]$j=[int]4
)
# Default values for variables.
#!/bin/bash
# Exit when an error happens instead of continue.
set -e
# Default values for flags.
DEBUG_TYPE="Release"
NUM_JOBS=4
MOCO="on"
CORE_BRANCH="main"
#!/bin/bash
# Exit when an error happens instead of continue.
set -e
# Default values for flags.
DEBUG_TYPE="Release"
NUM_JOBS=4
MOCO="on"
CORE_BRANCH="main"
@AlbertoCasasOrtiz
AlbertoCasasOrtiz / opensim-windows-build-script.ps1
Last active July 4, 2023 23:29
Script to build opensim-gui on Windows 7+
#Requires -RunAsAdministrator
param (
[switch]$s=$false,
[switch]$h=$false,
[string]$d="Release",
[string]$c="main",
[string]$g="main",
[int]$j=[int]4
)
@AlbertoCasasOrtiz
AlbertoCasasOrtiz / deploy_mac_qt.txt
Created October 15, 2020 01:11
Deployment Qt Mac
1. Build in release mode.
2. Execute macdeployqt. My project is formed by 2 subprojects. one of them containing the gui components (qrc, qml...), and other containing all the logic.
The project with the gui is in <Dir_to_gui_project>. <Dir_to_release> must contain the library generated by Qt from the logic project.
<Dir_to_Qt>/5.15.1/clang_64/bin/macdeployqt <app_name>.app -qmldir="<Dir_to_gui_project>" -libpath=<Dir_to_release>
3. Test that all Qt libraries are inside the bundle.
Use otool to see which libraries are required, then test if they are inside of <app_name>.app/Contents/Frameworks.
@AlbertoCasasOrtiz
AlbertoCasasOrtiz / keras_to_tflite.py
Created June 15, 2020 06:05
Convert keras model into tflite
import tensorflow as tf
from keras.models import model_from_json
keras.backend.clear_session()
# Model reconstruction from JSON file.
with open('model.json', 'r') as f:
model = model_from_json(f.read())
# Load weights from h5 file.
@AlbertoCasasOrtiz
AlbertoCasasOrtiz / change_colab_tf_version.py
Created June 12, 2020 07:06
Change Google colab Tensorflow version
# It is necessary to restart the environment before changing version
# if you have already imported tensorflow.
# Change to version 1.x
%tensorflow_version 1.x
import tensorflow
print(tensorflow.__version__)
1. Install PyInstaller as a dependency in File->Settings->Project->Project Interpreter.
2. In Edit Configurations, add as Interpreter Options: -m PyInstaller
3. Add -F if you want to generate a pacakge with just one executable file (can be slower).
3. Add --noconsole to get rid of console.