当前位置: 首页 > news >正文

C++面向对象设计基础

一般类、&、const、模板、友元函数、操作符重载基本用法及实现

complex.h

#ifndef COMPLEX_H
#define COMPLEX_H
#include<ostream>
using namespace std;template<typename T>
class Complex{public:Complex():re(0),img(0){}// 为什么构造函数不能传引用?// 原因:不能给引用形式传递临时变量//Complex<double> b(1.5, 2.0);改为以下两行即可传引用 //double x=1.5,y=2.0;             //Complex<double> b(x, y); Complex(T _re,T _img):re(_re),img(_img){}//传引用,但存在修改,函数不能用constvoid setRe(const T& _re){re=_re;}void setImg(const T& _img){img=_img;}//不能返回引用,返回引用代表可能修改,与const矛盾T getRe() const {return re;}T getImg() const{return img;}//调用类,必须要加上模板参数inline Complex<T>& operator+(const Complex<T>& a);//友元函数或者友元类可以访问类的私有变量//类内部使用友元函数模板,必须加上typenametemplate<typename N>inline friend Complex<N> operator+(const Complex<N>& a,const N& b);	template<typename N>inline friend Complex<N> operator+(const N& a,const Complex<N>& b);	private:T re;T img;
};//在类外实现模板类的成员函数时应该在成员函数之前加上关键字template
//成员函数前必须加上和类模板一样的声名template<typename T>,
//而且类的名称要写为Complex<T>。当在类外实现成员函数时,<T>不能省略。 
template<typename T>
inline Complex<T>& Complex<T>::operator+(const Complex<T>& a){this->re=this->re+a.re;this->img=this->img+a.img;return *this;
}template<typename T>
inline Complex<T> operator+(const Complex<T>& a,const T& b){Complex<T> sum=Complex<T>(a.re+b,a.img);return sum;
}template<typename T>
inline Complex<T> operator+(const T& a,const Complex<T>& b){Complex<T> sum= Complex<T>(a+b.re,b.img);return sum;
}// 重载的是ostream,必须有返回值,满足连续打印的情况。
template<typename T>
inline ostream& operator<<(ostream& os,const Complex<T>& a){return os<<a.getRe()<<"---"<<a.getImg();
}#endif  

complexTest.cpp

#include<iostream>
#include "complex.h"
using namespace std;
int main()
{Complex<double> a;a.setRe(2.0);a.setImg(3.0);cout << a << endl;Complex<double> b(1.5, 2.0);a = a + 3.0;cout << a << endl;Complex<double> c = a + b;cout << c << endl;Complex<double> d = 3.0 + b;cout << d << endl;cout << c<< endl << d;return 0;
}

含有指针的类,构造,拷贝构造,赋值,析构函数

myString.h

#ifndef MYSTRING_H
#define MYSTRING_H
#include<ostream>
#include<string.h>
using namespace std;
class myString{public:myString(const char* _str=0){//为什么这里必须判空,拷贝构造函数就不用? if(_str==0){str=new char[1];strcpy(str,"\0");}else{str=new char[strlen(_str)+1];strcpy(str,_str);}}// 拷贝构造函数必须使用引用,否则会无限循环myString(const myString& _str){str=new char[strlen(_str.str)+1];strcpy(str,_str.str);}myString& operator=(const myString& _str){if(str==_str.str){return *this;}else{delete []str;str=new char[strlen(_str.str+1)];strcpy(str,_str.str);return *this;}}// 必须要有析构~myString(){delete []str; }char* getStr() const{return str;}friend ostream& operator<<(ostream& os,myString& _str);private:char* str;
};//ostream& operator<<(ostream& os,myString _str){
//	return os<<_str.getStr();
//}// 友元函数类外实现
ostream& operator<<(ostream& os,myString& _str){return os<<_str.str;
}#endif

myStringTest.cpp

#include<iostream>
#include"myString.h"
using namespace std;
int main()
{myString a("defg");myString b;b = a; //调用的赋值函数myString c = a; // 调用的拷贝构造函数cout << a << "*" << b << "*" << c << "*" << endl;return 0;
}

类型转换函数、explicit用法

fraction.h

#ifndef FRACTION_H
#define FRACTION_Hclass Fraction{public://explicit不让构造函数发生自动转换//避免 operator double() const 与构造函数都可以类型转换发生二义性 explicit Fraction(int _numerator,int _denominator=1):numerator(_numerator),denominator(_denominator){}//在需要转换成double时自动调用 operator double() const{return (double)numerator/denominator;}Fraction& operator+(const Fraction& a){this->numerator = this->numerator*a.denominator + this->denominator+a.numerator;this->denominator = this->denominator * a.denominator;return *this;}private:int numerator;int denominator;
};#endif

fractionTest.cpp

#include<iostream>
#include"fraction.h"
using namespace std;
int main(){Fraction a(1, 4);cout << (double)a << endl;cout << a + 4;return 0;
}

将函数作为另一个函数参数两种方式:1)函数指针;2)仿函数

bigger.h

#ifndef BIGGER_H
#define BIGGER_Hclass BiggerThan{public:BiggerThan(double _x):x(_x){}bool operator()(const double& i) const {return i>x;}private:double x;
};#endif

functor.cpp

#include<iostream>
#include "bigger.h"
using namespace std;
// 仿函数
int biggerNumber(double* arr, int size, const BiggerThan& bigger){int cnt=0;for(int i=0;i<size;i++){bigger(arr[i])?cnt++:cnt;}return cnt;
}// 函数指针
int biggerNumberPoint(double* arr, int size, double cpy, bool (*fp)(double,double)){int cnt=0;for(int i=0;i<size;i++){fp(arr[i],cpy)?cnt++:cnt;}return cnt;
}
bool biggerPoint(double i,double x){return i>x;
}int main()
{BiggerThan bigger(10);double array[] = {1.4, 12.0, 14.0, 15.0, 3.0};cout << biggerNumber(array, 5, bigger) << endl;cout << biggerNumberPoint(array, 5, 10, biggerPoint) << endl;return 0;
};

智能指针

  • 智能指针可以自动释放占用的内存
  • shared_ptr 共享智能指针
  • unique_ptr独享智能指针,跟普通指针大小一样,不允许拷贝构造
  • weak_ptr共享指针指针,解决循环引用问题,从智能指针生成

pointer.h

#ifndef SMART_POINTER_POINTER_H
#define SMART_POINTER_POINTER_H
#include<memory>
#include<string>
#include<vector>
#include<iostream>
using namespace std;
class StringBlob{
public:StringBlob()  {}StringBlob(initializer_list<string> ss) : sp(make_shared<vector<string>>(ss)) {}void push_back(const string& s) {sp->push_back(s);}void pop_back(){if(check(0))sp->pop_back();}private:shared_ptr<vector<string> > sp;bool check(const int& i){if(i>0 && i<sp->size())return true;elsereturn false;}};
class WoMan;
class Man{
public://注意使用智能指针进行值传递时的内存泄露问题void setdata(shared_ptr<WoMan> _mdata){mdata = _mdata;}// 注意程序结束时析构函数是否会被调用,来判断是否存在内存泄漏问题~Man(){std::cout << "Man has destory" << std::endl;}
private:
//    shared_ptr<WoMan> mdata;weak_ptr<WoMan> mdata;
};class WoMan{
public:void setdata(shared_ptr<Man> _mdata){
//        std::cout << _mdata.use_count() << "......." << endl;mdata = _mdata;
//        std::cout << _mdata.use_count() << "......." << endl;}~WoMan(){std::cout << "woman has destory" << std::endl;};
private:shared_ptr<Man> mdata;
};
#endif //SMART_POINTER_POINTER_H

pointerTest.cpp

#include<iostream>
#include"pointer.h"
#include<string>
#include<iostream>
using namespace std;
int main()
{StringBlob s1 = {"test1", "tess4", "test5"};s1.push_back("test");// unique_ptr<string> up = new string("wuhjandaxue"); wrong explicit不允许拷贝构造//unique_ptr独享对象,一些基本用法unique_ptr<string> up(new string("wuhand"));unique_ptr<string> up3(new string("beijing"));string* up_point = new string("11111");cout << "unique_ptr size " << sizeof(up) << endl;cout << *up << endl;unique_ptr<string> up2(up.release()); // 所有权转移cout << *up2 << endl;cout <<  *up3 << endl;up3.reset(up_point); // 所有权转移cout << *up3 << endl;up3.reset(nullptr);// weak_ptr共享指针的复制指针,可以避免共享指针的循环引用问题shared_ptr<WoMan> woman = make_shared<WoMan>();shared_ptr<Man> man = make_shared<Man>();woman->setdata(man);man->setdata(woman);cout << man.use_count() << endl; // 2cout << woman.use_count() << endl; // 1cout << "............" << endl;//weak_ptr基本用法auto p = make_shared<int>(3);weak_ptr<int> w_p(p);cout << "wark ptr size " << sizeof(w_p) << endl;//返回指向w智能指针,或者空auto p2 = w_p.lock();cout << p.use_count() << endl;weak_ptr<int> w_p2(p);p2.reset();p.reset();// 判断p.use_count是否为0if(w_p2.expired()){cout << "p has no object" << endl;}cout << p.use_count() << endl;return 0;
}

可变参数、auto、Ranged-base

sample_c11.cpp

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void print()
{}
// 1. 可变参数
template<typename T, typename... Types>
void print(const T& first, const Types&... args)
{cout << first << endl;print(args...);
}int  main()
{print("wuhan", "beijing", 2333333);vector<int> test = {1, 50, 3, 5, 4};// vector<int>::iterator position = find(test.begin(), test.end(), 50);// 2. auto可以替代上面参数auto position =find(test.begin(), test.end(), 50);if(position != test.end()){cout << *position << endl;cout << "position " << distance(test.begin(), position) << endl;}// 3. ranged-base// 值访问for(auto i : test){cout << i << " ";}cout << endl;// 引用访问for(auto &i : test){i = 10;}for(auto i : test){cout << i << " ";}cout << endl;return 0;
}

继承和多态,虚函数、打破虚函数

quote.h

#ifndef QUOTE_H
#define QUOTE_H#include<iostream>
using namespace std;
class Quote{public:Quote(double _price):price(_price){}virtual const double sell_price() const{return price;}// 基类往往需要构造一个虚析构函数virtual ~Quote(){cout<<"Quote has destroy"<<endl;}protected:double price;	
};class Bulk_Quote:public Quote{public:Bulk_Quote(double _radio,double _price):radio(_radio),Quote(_price){}virtual const double sell_price() const{return price*radio;}virtual ~Bulk_Quote(){cout<<"Bulk_Quoto has destroy"<<endl;}private:double radio;
};#endif

quoteTest.cpp

#include<iostream>
#include "quote.h"
#include<memory>
using namespace std;
int main()
{Quote q1=Quote(10);Bulk_Quote q2=Bulk_Quote(0.5, 10);cout << q1.sell_price() << endl;cout << q2.sell_price() << endl;// 强制访问基类函数cout << q2.Quote::sell_price() << endl;//    智能指针方式调用 
//    unique_ptr<Quote> q1(new Quote(10));
//    unique_ptr<Quote> q2(new Bulk_Quote(0.5, 10));
//    // 多态条件:1)指针/引用 2)派生类到基类 3) 虚函数
//    cout << q1->sell_price() << endl;
//    cout << q2->sell_price() << endl;
//    // 强制访问基类函数
//    cout << q2->Quote::sell_price() << endl;return 0;
}

容器vector, list等、关联容器map, set等

stl_test.cpp

#include<iostream>
// 算法
#include<algorithm>
// 仿函数
#include<functional>
#include<vector>
#include<list>
#include<deque>
#include<set>
#include<map>
#include<unordered_set>
using namespace std;
int main()
{/*第一类容器..............*/cout << "..........vector............" << endl<<endl;vector<int> a = {1, 4, 3, 7, 10};a.push_back(8);cout << "vector size " << a.size() << endl;// vector capactity是以接近2^n进行容量增大的cout << "vector capacity " << a.capacity() << endl;// greater<int>()仿函数,本质是个模板,()创建了一个临时对象sort(a.begin(), a.end(), greater<int>());for(int temp : a){cout << temp << " " ;}cout<<endl;auto target = find(a.begin(), a.end(), 4);if(target != a.end())cout << "find target postion " << distance(a.begin(), target) << endl;cout << "..........list, foward_list............" << endl<<endl;//list, foward_list 地址不连续,不存在[]list<int> a_list = {7, 5, 2, 1, 6, 8};// 列表中自带了sort函数a_list.sort(greater<int>());// 遍历for(list<int>::iterator temp=a_list.begin(); temp!=a_list.end(); temp++){cout << *temp << " ";}cout<<endl;for(auto temp : a_list)cout << temp << " ";cout << endl;cout << "..........deque queue stack............" << endl<<endl;// deque queue stack是基于list实现的// deque由若干个buffer指针组成,每次扩充一个bufferdeque<int> a_deque = {7, 5, 2, 1, 6, 8};sort(a_deque.begin(), a_deque.end(), less<int>());for(auto temp : a_deque)cout << temp << " ";cout << endl;cout << "..........multiset multimap............" << endl<<endl;/*第二类容器,关联容器,适合查找,都含有自带的find函数*/// multiset multimap 都是基于二叉树实现的会默认按照key排序multiset<int> a_multiset = {3, 1, 3, 2, 5, 8, 7};a_multiset.insert(20);auto target_multiset = a_multiset.find(7);if(target_multiset != a_multiset.end())cout << "multiset find " << *target_multiset << endl<<endl;for(auto temp : a_multiset)cout << temp << " ";cout << endl;multimap<int, string> a_multimap = {make_pair(1, "wuhan"),make_pair(5, "beijing"),make_pair(3, "dongfang"),};for(auto temp : a_multimap)cout << temp.first << "  " << temp.second << endl;auto target_multimap = a_multimap.find(5);cout << "multimap find " << (*target_multimap).first << " " << (*target_multimap).second << endl;cout << "..........unordered_map unordered_set............" << endl<<endl;// 类似的是unordered_map和unordered_set// 基于hash表实现的,其中key没有排序,但查找速度更快(O(1)),multiset复杂度为(O(log(n)))// 但也没有重复元素unordered_set<int> a_unordered_set = {3, 1, 3, 2, 5, 8, 7};a_unordered_set.insert(20);for(auto temp : a_unordered_set)cout << temp << " ";cout << endl;// 第二个相关的是set和map,基于红黑树实现的,已经排序了,这中间也没有重复元素!cout << "................set map..............." << endl<<endl;set<int> a_set = {3, 1, 3, 2, 5, 8, 7};for(auto temp : a_set)cout << temp << " ";return 0;
}

相关文章:

C++面向对象设计基础

一般类、&、const、模板、友元函数、操作符重载基本用法及实现 complex.h #ifndef COMPLEX_H #define COMPLEX_H #include<ostream> using namespace std;template<typename T> class Complex{public:Complex():re(0),img(0){}// 为什么构造函数不能传引用&a…...

Linux定时运行sh脚本,如果sh文件已经在运行,则忽略本次运行

需求来源 我需要linux的crontab定期每10分钟运行lan.sh脚本。但由于lan.sh运行需要较长时间&#xff0c;有时超过10分钟。这样会导致系统多次运行lan.sh脚本&#xff0c;引发运行堆积&#xff0c;导致一些非必要的错误。 解决方法 解决方法是写一个脚本&#xff0c;如果lan.…...

SpringBoot项目中的web安全防护

最近这个月公司对项目进行了几次安全性扫描&#xff0c;然后扫描出来了一些安全漏洞&#xff0c;所以最近也一直在修复各种安全漏洞&#xff0c;还有就是最近在备考软考高级系统架构设计师&#xff0c;也刚好复习到了网络安全这一个章节&#xff0c;顺便将最近修复的安全漏洞总…...

stm32和python串口数据收发

1-1 串口发送端&#xff08;stm32&#xff09; 1字符串发送 void USART_SendData(USART_TypeDef* USARTx, uint16_t Data) {/* Check the parameters */assert_param(IS_USART_ALL_PERIPH(USARTx));assert_param(IS_USART_DATA(Data)); /* Transmit Data */USARTx->DR (D…...

无涯教程-jQuery - Dropable移动函数

Drop-able 功能可与JqueryUI中的交互一起使用。此功能可在任何DOM元素上启用可放置功能。 Drop able - 语法 $( "#droppable" ).droppable(); Drop able - 示例 以下是一个简单的示例&#xff0c;显示了drop-able的用法- <html><head><title>…...

【Python】Web学习笔记_flask(4)——钩子函数

钩子函数可以用来注册在请求处理的不同阶段执行出 Flask的请求钩子指的是在执行视图函数前后执行的一些函数&#xff0c; 之前是有4种&#xff0c;但是 before_first_request已经被删除了&#xff0c;使用时会报错 before_request&#xff1a;在每次请求前执行&#xff0c;…...

JavaScript 原型链解析,宏任务和微任务

目录 什么是原型链&#xff1f; 原型与构造函数 原型链的工作原理 实例&#xff1a;理解原型链 宏任务&#xff08;Macro Task&#xff09; 微任务&#xff08;Micro Task&#xff09; 什么是原型链&#xff1f; JavaScript 是一门基于原型的语言&#xff0c;而原型链是…...

05|Oracle学习(UNIQUE约束)

1. UNIQUE约束介绍 也叫&#xff1a;唯一键约束&#xff0c;用于限定数据表中字段值的唯一性。 1.1 UNIQUE和primary key区别&#xff1a; 主键/联合主键每张表中只有一个。UNIQUE约束可以在一张表中&#xff0c;多个字段中存在。例如&#xff1a;学生的电话、身份证号都是…...

glide加载content://com.android.contacts图片源码粗略梳理

获取链路是这样的&#xff1b; UriLoader类里定义了协议头&#xff1a; 里面有个内部类StreamFactory&#xff1a; 通过StreamLocalUriFetcher类的loadResource方法获取InputStream然后把流转换成为图片&#xff1b; 在这里作个草稿笔记给自己看...

【机器学习】Feature Engineering and Polynomial Regression

Feature Engineering and Polynomial Regression 1. 多项式特征2. 选择特征3. 缩放特征4. 复杂函数附录 首先&#xff0c;导入所需的库&#xff1a; import numpy as np import matplotlib.pyplot as plt from lab_utils_multi import zscore_normalize_features, run_gradien…...

Rust- 变量绑定

In Rust, you bind values to a variable name using the let keyword. This is often referred to as “variable binding” because it’s like binding a name to a value. Here’s a simple example: let x 5;In this example, x is bound to the value 5. By default, …...

向“数”而“深”,联想凌拓的“破局求变”底气何来?

前言&#xff1a;要赢得更多机遇&#xff0c;“破局求变”尤为重要。 【全球存储观察 &#xff5c; 热点关注】2019年2月25日&#xff0c;承袭联想集团与NetApp的“双基因”&#xff0c;联想凌拓正式成立。历经四年多的发展&#xff0c;联想凌拓已成为中国企业级数据管理领域的…...

pytorch实战-图像分类(二)(模型训练及验证)(基于迁移学习(理解+代码))

目录 1.迁移学习概念 2.数据预处理 3.训练模型&#xff08;基于迁移学习&#xff09; 3.1选择网络&#xff0c;这里用resnet 3.2如果用GPU训练&#xff0c;需要加入以下代码 3.3卷积层冻结模块 3.4加载resnet152模 3.5解释initialize_model函数 3.6迁移学习网络搭建 3.…...

b 树和 b+树的理解

项目场景&#xff1a; 图灵奖获得者&#xff08;Niklaus Wirth &#xff09;说过&#xff1a; 程序 数据结构 算法&#xff0c; 也就说我们无时无刻 都在和数据结构打交道。 只是作为 Java 开发&#xff0c;由于技术体系的成熟度较高&#xff0c;使得大部分人认为&#xff1…...

正则表达式 —— Awk

Awk awk&#xff1a;文本三剑客之一&#xff0c;是功能最强大的文本工具 awk也是按行来进行操作&#xff0c;对行操作完之后&#xff0c;可以根据指定命令来对行取列 awk的分隔符&#xff0c;默认分隔符是空格或tab键&#xff0c;多个空格会压缩成一个 awk的用法 awk的格式…...

国芯新作 | 四核Cortex-A53@1.4GHz,仅168元起?含税?哇!!!

创龙科技SOM-TLT507是一款基于全志科技T507-H处理器设计的4核ARM Cortex-A53全国产工业核心板&#xff0c;主频高达1.416GHz。核心板CPU、ROM、RAM、电源、晶振等所有元器件均采用国产工业级方案&#xff0c;国产化率100%。 核心板通过邮票孔连接方式引出MIPI CSI、HDMI OUT、…...

【MyBatis】 框架原理

目录 10.3【MyBatis】 框架原理 10.3.1 【MyBatis】 整体架构 10.3.2 【MyBatis】 运行原理 10.4 【MyBatis】 核心组件的生命周期 10.4.1 SqlSessionFactoryBuilder 10.4.2 SqlSessionFactory 10.4.3 SqlSession 10.4.4 Mapper Instances 与 Hibernate 框架相比&#…...

三、线性工作流

再生产的各个环节&#xff0c;正确使用gamma编码及gamma解码&#xff0c;使得最终得到的颜色数据与最初输入的物理数据一致。如果使用gamma空间的贴图&#xff0c;在传给着色器前需要从gamma空间转到线性空间。 如果不在线性空间下进行渲染&#xff0c;会产生的问题&#xff1a…...

2023华数杯数学建模A题思路 - 隔热材料的结构优化控制研究

# 1 赛题 A 题 隔热材料的结构优化控制研究 新型隔热材料 A 具有优良的隔热特性&#xff0c;在航天、军工、石化、建筑、交通等 高科技领域中有着广泛的应用。 目前&#xff0c;由单根隔热材料 A 纤维编织成的织物&#xff0c;其热导率可以直接测出&#xff1b;但是 单根隔热…...

Zabbix分布式监控Web监控

目录 1 概述2 配置 Web 场景2.1 配置步骤2.2 显示 3 Web 场景步骤3.1 创建新的 Web 场景。3.2 定义场景的步骤3.3 保存配置完成的Web 监控场景。 4 Zabbix-Get的使用 1 概述 您可以使用 Zabbix 对多个网站进行可用性方面监控&#xff1a; 要使用 Web 监控&#xff0c;您需要定…...

LongMemEval 基准实测!Awareness 长时记忆能力登顶

长时交互记忆是 AI 智能体从 “玩具” 走向 “生产力工具” 的核心门槛。LongMemEval 作为 ICLR 2025 收录的权威基准&#xff0c;专注评估多会话、跨时序、知识更新等五大记忆能力。本文基于 LongMemEval 完整测试集&#xff0c;对 Awareness 进行全维度 Benchmark&#xff0c…...

别再让机械臂‘抖’了!用Matlab手把手教你实现输入整形(附完整代码)

机械臂振动抑制实战&#xff1a;用Matlab实现输入整形的完整指南 看着机械臂末端执行器在定位后持续抖动的画面&#xff0c;作为工程师的你一定眉头紧锁。这种残余振动不仅影响定位精度&#xff0c;还会延长作业周期——在高速分拣、精密装配等场景下&#xff0c;这简直是性能杀…...

【实战教程+数据集】YOLOv8车牌识别数据集7811张,从数据标注到模型部署,构建智慧交通车牌检测系统

1. 车牌识别技术为何需要YOLOv8&#xff1f; 车牌识别听起来简单&#xff0c;但实际落地时会遇到各种头疼的问题。我去年帮一个停车场做改造时就深有体会——白天阳光强烈时反光严重&#xff0c;傍晚逆光时车牌变成黑乎乎一片&#xff0c;下雨天水珠还会在车牌上形成光斑。传统…...

惠普/H3C服务器iLO管理页面SSA配置详解:如何正确开启HBA模式与安装Windows系统

惠普/H3C服务器iLO管理界面SSA配置实战&#xff1a;HBA模式切换与Windows系统部署全指南 第一次接触惠普或H3C服务器的工程师&#xff0c;往往会被其独特的iLO带外管理系统和SSA存储配置工具所困扰。特别是当需要绕过硬件RAID直接使用单盘进行性能测试时&#xff0c;如何正确配…...

深度剖析:LangGraph中的状态管理与循环逻辑

深度剖析:LangGraph中的状态管理与循环逻辑 副标题:从核心原理到工业级落地,彻底掌握LangChain生态中下一代Agent编排的灵魂 第一部分:引言与基础 (Introduction & Foundation) 1. 引人注目的标题 深度剖析:LangGraph中的状态管理与循环逻辑——从核心原理到工业级…...

Py之pycocotools:从COCO数据加载到自定义标注可视化的实战指南

1. 为什么你需要pycocotools 如果你正在做计算机视觉相关的项目&#xff0c;特别是目标检测、实例分割这类任务&#xff0c;那么COCO数据集一定不会陌生。作为计算机视觉领域最常用的基准数据集之一&#xff0c;COCO提供了超过20万张标注图像&#xff0c;包含80个常见物体类别。…...

突破性AI技术:3大维度深度解析Zero123++图像生成新范式

突破性AI技术&#xff1a;3大维度深度解析Zero123图像生成新范式 【免费下载链接】zero123plus Code repository for Zero123: a Single Image to Consistent Multi-view Diffusion Base Model. 项目地址: https://gitcode.com/gh_mirrors/ze/zero123plus Zero123是一项…...

从MNIST到实战:拆解PyTorch CNN模型中的每一行代码,新手也能懂

从MNIST到实战&#xff1a;拆解PyTorch CNN模型中的每一行代码&#xff0c;新手也能懂 当你第一次看到PyTorch的CNN代码时&#xff0c;是否感觉像在读天书&#xff1f;那些Conv2d、view、optim.SGD背后究竟藏着什么秘密&#xff1f;让我们像拆解精密钟表一样&#xff0c;逐行剖…...

【GitHub项目推荐--Octogent:给 Claude Code 装上“章鱼触手”的多智能体编排层】⭐

Screenshots GitHub 地址&#xff1a;https://github.com/hesamsheikh/octogent 简介 Octogent​ 是一个构建在 Claude Code 之上的本地多智能体编排&#xff08;Orchestration&#xff09;层。它的名字源于“Octopus”&#xff08;章鱼&#xff09;和“Agent”&#xff08;智…...

共筑核电全生命周期技术支撑体系,华能核能技术研究院与核电运行研究院签署战略合作协议

华能核能技术研究院有限公司(以下简称&#xff1a;核能技术研究院)与核电运行研究(上海)有限公司(以下简称&#xff1a;核电运行研究院)正式签署合作意向书&#xff0c;双方将在党建共建&#xff0c;科研攻关&#xff0c;科技成果转化、应用等领域持续加强协同&#xff0c;携手…...