This file contains 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 xml.etree.ElementTree as ET | |
import pickle | |
import os,sys | |
from os import listdir, getcwd | |
from os.path import join | |
# TODO | |
classes = [""] # update with the classes of your dataset | |
def convert(size,box): |
This file contains 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 sys | |
import cv2 | |
# TODO update with this part with your ip address | |
cap = cv2.VideoCapture("tcp://192.168.68.97:18003") | |
while(True): | |
ret, frame = cap.read() | |
cv2.imshow('frame', frame) | |
if cv2.waitKey(1) & 0xFF == ord('q'): |
This file contains 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
#!/usr/bin/env python3 | |
from socket import socket, gethostbyname, AF_INET, SOCK_DGRAM | |
import sys | |
PORT_NUMBER = 5000 | |
SIZE = 1024 | |
hostName = gethostbyname( '0.0.0.0' ) | |
mySocket = socket( AF_INET, SOCK_DGRAM ) |
This file contains 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
# Docker container logs | |
import datetime | |
import docker | |
import time | |
import os | |
# how to run it | |
# python3 docker_logs.py | |
# TODO update the name for the correct one on the drone |
This file contains 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
#!/usr/bin/env python3 | |
import sys | |
from socket import socket, AF_INET, SOCK_DGRAM | |
# TODO update this part with the IP address of the server and port number used | |
SERVER_IP = '172.19.0.3' | |
PORT_NUMBER = 5000 | |
SIZE = 1024 | |
print ("Test client sending packets to IP {0}, via port {1}\n".format(SERVER_IP, PORT_NUMBER)) |
This file contains 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
# TODO Add the code below to your barshrc file | |
# Git branch in prompt. | |
force_color_prompt=yes | |
color_prompt=yes | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' |
This file contains 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
Create a new container from the TensorFlow image | |
""" | |
$ docker run -it --rm tensorflow/tensorflow:latest-gpu-py3 | |
""" | |
You should be logged-in in the new container. You can explore it using ls, cd, etc… | |
You can exit using | |
$ exit. | |
Create a directory to exchange files between your machine and the container: |
This file contains 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
# tensorflow | |
from tensorflow.python.client import device_lib | |
devices_tf = device_lib.list_local_devices() | |
devices_tf = print(devices) | |
# pytorch | |
import torch | |
devices_torch = torch.cuda.get_device_name() | |
print(devices_torch) |
This file contains 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
# reset last git commit | |
git reset --soft HEAD~1 |
This file contains 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
# add this at the end of your entrypoint file | |
# to keep the container running and not exit directly | |
set -x | |
while $1 | |
do | |
echo "Press [CTRL+C] to stop.." | |
sleep 5 | |
echo "My second and third argument is $2 & $3" | |
done |
OlderNewer