Commit 5485544f authored by Carsten Eie Frigaard's avatar Carsten Eie Frigaard
Browse files

modified_yolov5_install_structure

parent 0d340a34
#!/bin/bash
set -ea
conda create --name yolov5
conda env list
conda activate yolov5
test -f yolov5 || git clone https://github.com/ultralytics/yolov5
cd yolov5
pip install -r requirements.txt
\ No newline at end of file
#!/usr/bin/env python3
import torch
import sys
def Versions():
print("VERSIONS:")
print(f" _sys.version = { sys.version}")
print(f" torch.__version__ = {torch.__version__}")
print(f" torch.cuda.is_available() = {torch.cuda.is_available()}")
print(f" torch.backends.cudnn.enabled = {torch.backends.cudnn.enabled}")
device = torch.device("cuda")
print(f" torch.cuda.get_device_properties(device) = {torch.cuda.get_device_properties(device)}")
print(f" torch.tensor([1.0, 2.0]).cuda() = {torch.tensor([1.0, 2.0]).cuda()}")
def PredictDemo():
# Model
model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # or yolov5m, yolov5l, yolov5x, custom
# Images
#img = 'https://ultralytics.com/images/zidane.jpg' # or file, Path, PIL, OpenCV, numpy, list
img = 'Figs/zidane.jpg'
# Inference
results = model(img)
# Results
results.print() # or .show(), .save(), .crop(), .pandas(), etc.
#results.show()
results.save('temp.jpg')
Versions()
PredictDemo()
\ No newline at end of file
......@@ -571,9 +571,9 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python [conda env:.conda-yolov5]",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "conda-env-.conda-yolov5-py"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
......@@ -585,7 +585,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.11"
"version": "3.9.7"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
......@@ -935,5 +935,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
# pip install -r requirements.txt
# Base ----------------------------------------
matplotlib>=3.2.2
numpy>=1.18.5
opencv-python>=4.1.2
Pillow>=7.1.2
PyYAML>=5.3.1
requests>=2.23.0
scipy>=1.4.1
#torch>=1.7.0
#torchvision>=0.8.1
torch>=1.10.1+cu111
torchvision>=0.11.2+cu111
torchaudio>=0.10.1
tqdm>=4.41.0
# Logging -------------------------------------
tensorboard>=2.4.1
# wandb
# Plotting ------------------------------------
#pandas>=1.1.4
#seaborn>=0.11.0
# Export --------------------------------------
# coremltools>=4.1 # CoreML export
# onnx>=1.9.0 # ONNX export
# onnx-simplifier>=0.3.6 # ONNX simplifier
# scikit-learn==0.19.2 # CoreML quantization
# tensorflow>=2.4.1 # TFLite export
# tensorflowjs>=3.9.0 # TF.js export
# openvino-dev # OpenVINO export
# Extras --------------------------------------
# albumentations>=1.0.3
# Cython # for pycocotools https://github.com/cocodataset/cocoapi/issues/172
# pycocotools>=2.0 # COCO mAP
# roboflow
thop # FLOPs computation
#!/bin/bash
set -ea
# NOTE: could create a new env. but most things are ok
# when using anaconda-2021.11 ..
#conda create --name yolov5
#conda env list
#conda activate yolov5
test -f yolov5 || git clone https://github.com/ultralytics/yolov5
#cd yolov5
#pip install -r requirements.txt
# NOTE: torch version in original requirements incompatible with GPU hardware,
# use the following instead ..
pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 torchaudio==0.10.1 -f https://download.pytorch.org/whl/torch_stable.html
# NOTE: then install whatever is not in conda ..
pip install -r swmal_requirements.txt
\ No newline at end of file
......@@ -30,7 +30,6 @@ def Versions():
except:
print(f'WARN: could not find cv2 (opencv)!')
def TestAll():
Versions()
print("ALL OK")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment