Tuesday, April 27, 2021

Edward Lance Lorilla

Edward Lance Lorilla


【JAVASCRIPT】social media share native component

Posted: 27 Apr 2021 01:01 AM PDT

【LARAVEL and FLUTTER ANDROID STUDIO and IOS】Ecommerce Shopping

Posted: 27 Apr 2021 12:54 AM PDT

Flutter Code Laravel Code

【VISUAL VB NET】Ping

Posted: 26 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.NetworkInformation; is included Imports System.Net.NetworkInformation' make sure that using System.Threading; is included for method Sleep Imports System.Threading Public Class Form1 Public Sub New() MyBase.New() InitializeComponent() End Sub Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click For i As Integer = 0 To 3 ' Thread.Sleep(500); Using p As New Ping() ' label1.Text = p.Send("www.google.com").RoundtripTime.ToString() + "ms"; listView1.Items.Add(p.Send("www.google.com").RoundtripTime.ToString() & "ms" & vbLf) End Using Next End SubEnd Class

【PYTHON OPENCV】Image classification OpenCV CNN module AlexNet and caffe pre trained models

Posted: 26 Apr 2021 08:54 AM PDT

 


""" Image classification using OpenCV CNN module using AlexNet and caffe pre-trained models (bvlc_alexnet.caffemodel not included because exceeds GitHub's file size limit of 100.00 MB) bvlc_alexnet.prototxt: https://github.com/opencv/opencv_extra/blob/master/testdata/dnn/bvlc_alexnet.prototxt bvlc_alexnet.caffemodel: http://dl.caffe.berkeleyvision.org/bvlc_alexnet.caffemodel """ # Import required packages:import cv2import numpy as npfrom matplotlib import pyplot as plt def show_img_with_matplotlib(color_img, title, pos): """Shows an image using matplotlib capabilities""" img_RGB = color_img[:, :, ::-1] ax = plt.subplot(1, 1, pos) plt.imshow(img_RGB) plt.title(title) plt.axis('off') # Load the names of the classes:rows = open('synset_words.txt').read().strip().split('\n')classes = [r[r.find(' ') + 1:].split(',')[0] for r in rows] # Load the serialized caffe model from disk:net = cv2.dnn.readNetFromCaffe("bvlc_alexnet.prototxt", "bvlc_alexnet.caffemodel") # Load input image:image = cv2.imread("church.jpg") # Create the blob with a size of (227,227), mean subtraction values (104, 117, 123)blob = cv2.dnn.blobFromImage(image, 1, (227, 227), (104, 117, 123))print(blob.shape) # Feed the input blob to the network, perform inference and get the output:net.setInput(blob)preds = net.forward() # Get inference time:t, _ = net.getPerfProfile()print('Inference time: %.2f ms' % (t * 1000.0 / cv2.getTickFrequency())) # Get the 10 indexes with the highest probability (in descending order)# This way, the index with the highest prob (top prediction) will be the first:indexes = np.argsort(preds[0])[::-1][:10] # We draw on the image the class and probability associated with the top prediction:text = "label: {}\nprobability: {:.2f}%".format(classes[indexes[0]], preds[0][indexes[0]] * 100)y0, dy = 30, 30for i, line in enumerate(text.split('\n')): y = y0 + i * dy cv2.putText(image, line, (5, y), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (0, 255, 255), 2) # Print top 10 prediction:for (index, idx) in enumerate(indexes): print("{}. label: {}, probability: {:.10}".format(index + 1, classes[idx], preds[0][idx])) # Create the dimensions of the figure and set title:fig = plt.figure(figsize=(10, 6))plt.suptitle("Image classification with OpenCV using AlexNet and caffe pre-trained models", fontsize=14, fontweight='bold')fig.patch.set_facecolor('silver') # Show the output image:show_img_with_matplotlib(image, "AlexNet and caffe pre-trained models", 1) # Show the Figure:plt.show()

【GAMEMAKER】Toggle quest complete

Posted: 26 Apr 2021 08:46 AM PDT

 Information about object: obj_example

Sprite:
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:

///Set Up Data
quest[1,1]="Collect 100 Treasure Chests"; //name of quest
quest[1,2]=false; //whether completed (true) or not completed (false);

quest[2,1]="Defeat All Bosses"; //name of quest
quest[2,2]=true; //whether completed (true) or not completed (false);

quest[3,1]="Puzzle Room"; //name of quest
quest[3,2]=false; //whether completed (true) or not completed (false);

quest[4,1]="Find All Hidden Locations"; //name of quest
quest[4,2]=false; //whether completed (true) or not completed (false);

Step Event:
execute code:

///toggle completion true / false
//for example only
if keyboard_check_pressed(ord('1'))
{
quest[1,2]=!quest[1,2]
}

if keyboard_check_pressed(ord('2'))
{
quest[2,2]=!quest[2,2]
}

if keyboard_check_pressed(ord('3'))
{
quest[3,2]=!quest[3,2]
}

if keyboard_check_pressed(ord('4'))
{
quest[4,2]=!quest[4,2]
}
Draw Event:
execute code:

for (var loop = 1; loop <=4; loop += 1)
{
//set drawing colour based on true/false
if quest[loop,2]
{
draw_set_colour(c_green);
}
else
{
draw_set_colour(c_red);
}
//draw description
draw_text(10,100+(loop*100),quest[loop,1]);
//draw completed or not
if quest[loop,2]
{
draw_text(500,100+(loop*100),"Completed");
}
else
{
draw_text(500,100+(loop*100),"Not Completed");
}

}

draw_set_colour(c_black);
draw_text(10,700,"Press 1 2 3 4 To Toggle");

【VUE.JS】Automatic perspective correction OpenCV.js

Posted: 26 Apr 2021 05:58 AM PDT

No comments:

Post a Comment