Edward Lance Lorilla |
- 【VUEJS】video playback speed
- 【GAMEMAKER】 items that can be picked up and inventory
- 【PYTHON OPENCV】dlib library to calculate the 128D descriptor to be used for face
- 【VISUAL VB.NET】Download file via HTTP
| Posted: 18 Apr 2021 02:53 AM PDT |
| 【GAMEMAKER】 items that can be picked up and inventory Posted: 17 Apr 2021 09:14 AM PDT Information about object: obj_inventory Sprite: Solid: false Visible: true Depth: -1000 Persistent: true Parent: Children: Mask: No Physics Object Create Event: execute code: Step Event: execute code: Draw Event: execute code: Information about object: obj_mouseitem |
| 【PYTHON OPENCV】dlib library to calculate the 128D descriptor to be used for face Posted: 17 Apr 2021 09:05 AM PDT """ This script makes used of dlib library to calculate the 128-dimensional (128D) descriptor to be used for face recognition. Face recognition model can be downloaded from: https://github.com/davisking/dlib-models/blob/master/dlib_face_recognition_resnet_model_v1.dat.bz2 """ # Import required packages:import cv2import dlibimport numpy as np # Load shape predictor, face enconder and face detector using dlib library:pose_predictor_5_point = dlib.shape_predictor("shape_predictor_5_face_landmarks.dat")face_encoder = dlib.face_recognition_model_v1("dlib_face_recognition_resnet_model_v1.dat")detector = dlib.get_frontal_face_detector() def face_encodings(face_image, number_of_times_to_upsample=1, num_jitters=1): """Returns the 128D descriptor for each face in the image""" # Detect faces: face_locations = detector(face_image, number_of_times_to_upsample) # Detected landmarks: raw_landmarks = [pose_predictor_5_point(face_image, face_location) for face_location in face_locations] # Calculate the face encoding for every detected face using the detected landmarks for each one: return [np.array(face_encoder.compute_face_descriptor(face_image, raw_landmark_set, num_jitters)) for raw_landmark_set in raw_landmarks] # Load image:image = cv2.imread("jared_1.jpg") # Convert image from BGR (OpenCV format) to RGB (dlib format):rgb = image[:, :, ::-1] # Calculate the encodings for every face of the image:encodings = face_encodings(rgb) # Show the first encoding:print(encodings[0]) |
| 【VISUAL VB.NET】Download file via HTTP Posted: 17 Apr 2021 08:58 AM PDT Imports System Imports System.Collections.GenericImports System.ComponentModelImports System.DataImports System.DrawingImports System.LinqImports System.TextImports System.Threading.TasksImports System.Windows.Forms' make sure that using System.Diagnostics; is included Imports System.Diagnostics' make sure that using System.Security.Principal; is included Imports System.Security.Principal ' make sure that using System.Net; is included Imports System.Net Public Class Form1Public Sub New() MyBase.New InitializeComponent End Sub Private webClient As New WebClient() Private Sub webClient_DownloadProgressChanged(sender As Object, e As DownloadProgressChangedEventArgs) Dim bytesIn As Double = Double.Parse(e.BytesReceived.ToString()) Dim totalBytes As Double = Double.Parse(e.TotalBytesToReceive.ToString()) Dim percentage As Double = bytesIn / totalBytes * 100 progressBar1.Value = Integer.Parse(Math.Truncate(percentage).ToString()) End Sub Private Sub webclient_DownloadFileCompleted(sender As Object, e As AsyncCompletedEventArgs) MessageBox.Show("Saved as C:\MYRAR.EXE", "Httpdownload") End Sub#Region "basic function for app" Private Sub lblLink_Click_1(sender As Object, e As EventArgs) Handles lblLink.Click Process.Start("www.vclexamples.com") End Sub Protected Overrides Function ProcessCmdKey(ByRef msg As Message, ByVal keyData As Keys) As Boolean If (keyData = Keys.Escape) Then Me.Close() Return True End If Return MyBase.ProcessCmdKey(msg, keyData) End Function#End Region Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click AddHandler WebClient.DownloadProgressChanged, New DownloadProgressChangedEventHandler(AddressOf webClient_DownloadProgressChanged) AddHandler WebClient.DownloadFileCompleted, New AsyncCompletedEventHandler(AddressOf webclient_DownloadFileCompleted) ' start download WebClient.DownloadFileAsync(New Uri(textBox1.Text), "C:\\MYRAR.EXE") End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End SubEnd Class |
| You are subscribed to email updates from Edward Lance Lorilla. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
| Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States | |
No comments:
Post a Comment