Skip to content

Instantly share code, notes, and snippets.

View vincentAgnus's full-sized avatar

Vincent AGNUS vincentAgnus

  • DeepTech UP
  • Strasbourg
View GitHub Profile
@vincentAgnus
vincentAgnus / version_info.py
Created March 22, 2023 16:57
Get module/lib version of your env
from importlib.metadata import PackageNotFoundError
from importlib.metadata import version as get_module_version
import subprocess
import os
python_libs ="""
torch
tensorflow
tensorboard
@vincentAgnus
vincentAgnus / image_b64.ipynb
Last active May 16, 2022 16:14
Transform numpy image in/from a web standard
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vincentAgnus
vincentAgnus / confusionMatrixFromPanda.ipynb
Created May 3, 2022 09:27
How to create a confusion matrix from panda
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vincentAgnus
vincentAgnus / plotly_visual_debug.py
Created April 29, 2022 07:48
a Class to quickly visual debugging using plotly
""" the purpose of this class is to propose a visual debugger based on plotly
example
vd = VisualDebugger(image)
vd.points([1,2],name="a point")\
.points( [x1,x2,y1,y2,....], name="a segment" ) \
.points( numpy arrau, name="a point or segment") \
.show()
@vincentAgnus
vincentAgnus / run_python_script_in_conda_env.bat
Created November 12, 2021 10:32 — forked from maximlt/run_python_script_in_conda_env.bat
Run a Python script in a conda environment from a batch file
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.
rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init
rem Define here the path to your conda installation
set CONDAPATH=C:\ProgramData\Miniconda3
rem Define here the name of the environment
@vincentAgnus
vincentAgnus / Makefile
Last active January 7, 2021 22:07
Makefile to init a dockerized symfony project
.PHONY: help project-init docker-build docker-up install-vendors jwt-init db-init hello
.DEFAULT_GOAL = help
project-init: docker-build docker-up install-vendors jwt-init db-init hello ## Install and init project
docker-build: ## Build docker image
docker-compose build
@vincentAgnus
vincentAgnus / openvpn.md
Created November 18, 2020 00:25 — forked from Morley93/openvpn.md
This is how you can take an openvpn .ovpn config file and extract the certificates/key required to import the profile into NetworkManager.

OpenVPN .ovpn manipulation.

This is how you can take an OpenVPN .ovpn config file and extract the certificates/keys required to import the profile into NetworkManager.

  • Download the .ovpn file. Save it somewhere you can store it permanently (I use ~/.vpn).
  • Copy from between <ca> tags into ca.crt, remove <ca> tags.
  • Copy from between <cert> tags into client.crt, remove <cert> tags.
  • Copy from between <key> tags into client.key, remove <key> tags.
  • Copy from between <tls-auth> tags into ta.key, remove <tls-auth> tags.
  • Remove the line "key-direction 1"
  • Above "# -----BEGIN RSA SIGNATURE-----" insert the following lines.
@vincentAgnus
vincentAgnus / install_anaconda.md
Created November 29, 2019 11:15 — forked from kauffmanes/install_anaconda.md
Install Anaconda on Windows Subsystem for Linux (WSL)

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_65.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose Anaconda3-5.2.0-Linux-x86_64.sh.
  4. From the terminal run wget https://repo.continuum.io/archive/[YOUR VERSION]. Example: $ wget https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh
  5. Run the installation script: $ bash Anaconda[YOUR VERSION].sh ($ bash Anaconda3-5.2.0-Linux-x86_64.sh)
  6. Read the license
@vincentAgnus
vincentAgnus / RTStruct_mon_amour.ipynb
Last active November 12, 2019 21:56
RTStructMultiPolygones
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vincentAgnus
vincentAgnus / convert_xcf2ora.py
Created October 1, 2019 14:08
a gimp plugin extension to batch transform Gimp XCF to OpenRaster ORA. (@by my trainee Arthur Pfauwadel)
import fnmatch
import os, glob, sys, time
from gimpfu import *
"""version of oraconverter meant to be used as a gimp plugin"""
def process(infile, convert_folder):
pdb.gimp_progress_set_text("Processing file %s " % infile)
image = pdb.gimp_xcf_load(0, infile, infile) # 0 is dummy parameter, whatever this is