This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
free_GPU_mem, global_GPU_mem = torch.cuda.mem_get_info() | |
print(f"Free GPU memory: {free_GPU_mem/(1024 * 1024 * 1024)} GB") | |
print(f"Global GPU memory: {global_GPU_mem/(1024 * 1024 * 1024)} GB") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import skimage | |
FILE_NAME = "picture.jpg" # insérer le nom du fichier à charger. | |
img = skimage.io.imread(FILE_NAME) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from skimage.color import rgb2gray | |
img_gray = rgb2gray(img_color) # où img_color est l'image couleur que vous souhaitez convertir en noir et blanc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from skimage import data | |
from skimage.color import rgb2gray | |
img_color = data.chelsea() | |
plt.imshow(img_color) | |
plt.show() | |
img_gray = rgb2gray(img_color) | |
plt.imshow(img_gray, cmap="gray") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from skimage import data | |
from skimage.color import rgb2gray | |
# Chargement de l'image | |
img = rgb2gray(data.chelsea()) | |
from scipy.ndimage import gaussian_filter | |
# Application d'un filtre gaussien | |
sigma = 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
is_free = torch.cuda.is_available() | |
if is_free: | |
print("GPU disponible.") | |
else: | |
print("Pas de GPU disponible.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip uninstall <NOM DU PACKAGE> | |
# Par exemple, pour désinstaller numpy, on fera: pip uninstall numpy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip show <NOM DU PACKAGE> | |
# Par exemple, si l'on veut connaître la version de numpy, on fera: pip show numpy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install <NOM DU PACKAGE>==<VERSION SOUHAITÉE> | |
# Par exemple, si l'on veut installer la version 1.21 de numpy, on fera: pip install numpy==1.21 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ $(sfc 2>&1 | tr -d '\0') =~ SCANNOW ]]; then echo Administrator; else echo $USERNAME; fi |
OlderNewer