Skip to content

Instantly share code, notes, and snippets.

View giljr's full-sized avatar
💭
Full Stack Developer with a degree in Computer Engineering.

Gilberto Oliveira Jr giljr

💭
Full Stack Developer with a degree in Computer Engineering.
View GitHub Profile
@giljr
giljr / gist:80fb05f2eaced449cc818b7ea982371c
Created May 26, 2023 21:45
JUPYTER NOTEBOOK ON Ubuntu
JUPYTER NOTEBOOK - Installation UBUNTU jupyter notebook:
https://www.digitalocean.com/community/tutorials/how-to-set-up-jupyter-notebook-with-python-3-on-ubuntu-18-04
sudo apt update
sudo apt install python3-pip python3-dev
sudo -H pip3 install --upgrade pip
sudo -H pip3 install virtualenv
mkdir ~/my_project_dir
cd ~/my_project_dir
virtualenv my_project_env
Installing nodejs and npm
Prerequisites
Ubuntu 18.04 or 20.04
A user with sudo privileges.
1- Install Node.js and NPM from Ubuntu Repository
The easiest way to install Node.js and NPM is from the Ubuntu repository.
# https://stackoverflow.com/questions/6118779/how-to-change-default-timezone-for-active-record-in-rails
# 0 -To find your tz: rake time:zones:all
# 1- To run: bundle exec rake time:zones:all
# 2- To test: rails console > Time.zone and Time.now
config.time_zone = "Atlantic Time (Canada)"
config.active_record.default_timezone = :local
from datetime import datetime, timedelta
import requests
import yagmail
import os
MY_LAT = -8.761070
MY_LNG = -63.885980
timezone_hour_offset = -4
# https://stackoverflow.com/questions/65827830/disabledfunctionerror-cv2-imshow-is-disabled-in-colab-because-it-causes-jupy
from google.colab.patches import cv2_imshow
from PIL import Image
import face_recognition
import cv2
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
Added packages:
8 - anaconda_depends 2020.02 py37_0 8
32 - binutils_impl_linux-64 2.36.1 h193b22a_2 conda-forge
33 - binutils_linux-64 2.36 hf3e587d_1 conda-forge
84 - flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
90 - gcc_impl_linux-64 11.1.0 h6b5115b_8 conda-forge
91 - gcc_linux-64 11.1.0 h97fdae6_1 conda-forge
102 - gxx_impl_linux-64 11.1.0 h6b5115b_8 conda-forge
103 - gxx_linux-64 11.1.0 h33c4e4b_1 conda-forge
import face_recognition
import numpy as np
from PIL import Image, ImageDraw
# Load a sample picture and learn how to recognize it.
known_image = face_recognition.load_image_file("toby.jpg")
encoding = face_recognition.face_encodings(known_image)[0]
# Load an image with unknown faces
unknown_image = face_recognition.load_image_file("office.jpg")
from PIL import Image
import face_recognition
# Load the jpg file into a numpy array
image = face_recognition.load_image_file("office.jpg")
# Find all the faces in the image using the default HOG-based model.
# This method is fairly accurate, but not as accurate as the CNN model and not GPU accelerated.
# See also: find_faces_in_picture_cnn.py
face_locations = face_recognition.face_locations(image)
Sorted first second third ... antepenultimate penultimate last
RANDOM QUICK SHELL MERGE ... SELECTION COCKTAIL BUBBLE
UNIQUE QUICK SHELL MERGE ... SELECTION COCKTAIL BUBBLE
REVERSED QUICK SHELL MERGE ... INSERTION BUBBLE COCKTAIL
ALMOST INSERTION COCKTAIL QUICK ... HEAT BUBBLE SELECTION
# ReadMe File - For Django Project + VS Code
# Tutorial: https://medium.com/jungletronics/django-mtv-in-vs-code-a5953b09a4fd
Django version 4.0
Python 3.9.7
How to use (On Terminal):
1- Activate your djangoEnv -> djangoEnv\Scripts\activate