Html5 video 视屏播放
<!doctype html>
<html>
<head>
<title>APP</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no”/>
<meta http-equiv=”Content-Type” conte
<!doctype html>
<html>
<head>
<title>APP</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no”/>
<meta http-equiv=”Content-Type” conte
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.ML;
using Microsoft.ML.Data;
namespace MLApp
{
internal class Program
{
pu
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.utils.data as Data
import torchvision
import matplotlib.pyplot as plt
import os
# 批训练加速模型的训练速度
EPOCH = 1
# 定义批次训练的batch数
BATCH_SIZE = 50
# 定义
线性回归模型,使用房屋大小和价格数据预测房屋价格。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.ML;
using Microsoft.ML.Data;
namespace MLApp
{
internal class Program
import numpy as np
import tensorflow as tf
import keras
import numpy as np
import matplotlib.pyplot as plt
from keras.layers import Dense
from keras.models import Sequential
from keras.optimizers import SGD
from keras.layers import
一、安装
pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple/
二、查看版本
1、输入python命令,进入 python 交互式命令行界面。
2、导入我们安装好的tensorflow。
import tensorflow
3、输入下面代码,注意:version前后各有两个下划线,只输入一个会报错。
print(tensorflow.__version__)
一、创建应用
打开 Visual Studio 并新建 .NET 控制台应用:
1、从 Visual Studio 2022 开始窗口中选择 新建项目。
2、选择 C# 控制台应用 项目模板。
3、将项目名称更改为 MLApp。
4、确保不选中将解决方案和项目置于同一目录中。
5、选择“下一步”按钮。
6、选择 .NET Framework 4.8。
7、选择“创建”按钮。Visual Studio 将创建项目并加载 Program.cs 文件。
二、添加机器学习
安装 Visual Studio 2022。在安装过程中,应选择 .NET 桌面开发工具以及可选的 ML.NET Model Builder 组件。
写c++程序的时候,使用 #include <string> 的时候,使用函数前要用
using namespace std; 导入命名空间。
因为c++增加了名称空间概念,将原来声明在全局空间下的标识符声明在了namespace std下。
#include <string>
using namespace std;
void main()
{
string user = “jiangzhihao”;
printf(“look
一、原图
opencv4.7\sources\samples\data\digits.png
//读取OpenCV自带的一张手写体数字图,尺寸为Size(2000,1000),其中每个数字为(20,20)的区域,总共有 [(1000/20)x(2000/20)] 共5000个数字。
二、分割图片
// 使用math库里的宏常量
#define _USE_MATH_DEFINES
#include <iostream>
#include <fil
一、训练模型
using OpenCvSharp;
using OpenCvSharp.Extensions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Th
官网地址:http://yann.lecun.com/exdb/mnist/
import numpy as np
import cv2
import os
# 将二进制格式的MNIST数据集转成.png图片格式并保存,图片标签包含在图片名中。
def save_mnist_to_png(mnist_image_file, mnist_label_file, save_dir):
if ‘train’ in os.path.basename(mni
import cv2
import numpy as np
import matplotlib.pyplot as plt
point_all = np.random.randint(0, 100, (20, 2))
# 随机选择20个点
label_all = np.random.randint(0, 2, (20, 1))
# 为随机点随机分配标志
label_0 = point_all[label_all.ravel() == 0]
# 分出标志为0的
// 使用math库里的宏常量
#define _USE_MATH_DEFINES
#include <iostream>
#include <filesystem>
#include <string>
#include <windows.h>
#include <opencv2/opencv.hpp>
namespace fs = std::filesystem;
using namespa
// 使用math库里的宏常量
#define _USE_MATH_DEFINES
#include <iostream>
#include <filesystem>
#include <string>
#include <windows.h>
#include <opencv2/opencv.hpp>
namespace fs = std::filesystem;
using namespace
// 使用math库里的宏常量
#define _USE_MATH_DEFINES
#include <iostream>
#include <filesystem>
#include <string>
#include <windows.h>
using namespace std;
// 对数 指数
void test_math()
{
// 对数函数
double param, result;
package cn.howsky.app.util;
public class Test {
public static void main(String[] args) {
// 数值的平方根
double x = 4;
double y = Math.sqrt(x);
System.out.println(“4的平方根” + y);
// 将 c 的值设置为 a 的 b 次幂
double a = 3;
double b = 2;
double
double m, n;
m = Math.Exp(0.5); // 自然对数e的0.5次方
Console.WriteLine(“自然对数e的0.5次方:” + m);
n = Math.Exp(30); // 自然对数e的30次方
Console.WriteLine(“自然对数e的30次方:” + n);
n = Math.Log(3); // 以e为底,3的对数
Console.WriteLine(“以e为底,3的对数:” + n);
n = Math.L
#include <iostream>
#include <filesystem>
#include <string>
#include <windows.h>
#include <opencv2/opencv.hpp>
namespace fs = std::filesystem;
using namespace cv;
using namespace std;
// 模板匹配
void te
#include <iostream>
#include <filesystem>
#include <string>
#include <windows.h>
#include <opencv2/opencv.hpp>
namespace fs = std::filesystem;
using namespace cv;
using namespace std;
// 图片缩放
void te