當前位置:首頁 » 操作系統 » ai源碼

ai源碼

發布時間: 2023-02-13 04:48:39

Ⅰ TrinityCore國外源代碼編譯後,NPC都沒有AI拜託各位了 3Q

TrinityCore v2運行需要3個資料庫:auth(賬號信息),characters(角色信息),world(游戲數據信息),其中auth和characters的生成SQL將在編譯的過程中生成,world需要在git上面下載。所以資料庫缺失是正常的!

Ⅱ 如果想優化ai模型部署,哪些源碼值得一讀

想優化ai模型部署,以下3個源碼值得一讀。
1、普通應用程序或網路應用場景中的源碼值得一讀。
2、Paddle模型源碼。
3、AI模型的快速端雲部署源碼。

Ⅲ 有沒有微信小程序調用百度ai車輛識別介面的程序源碼,很簡單的就可以

class BaiDuAiBaseController extends BaseController
{
private $appid;
private $appKey;
private $secretKey;

public function __construct(){
$this->appid= config('api..appid');
$this->appKey = config('api..apikey');
$this->secretKey = config('api..secretkey');
}

//網路ai介面--文字識別--車牌號識別
public function getCarNumber($_imgurl,$_img=''){
$_token = $this->getToken();
$_url = 'https://aip.bce.com/rest/2.0/ocr/v1/license_plate?access_token='.$_token;
if($_img){
$_data = [
'image'=>$_img//圖像數據,base64編碼後進行urlencode,要求base64編碼和urlencode後大小不超過4M,最短邊至少15px,最長邊最大4096px,支持jpg/jpeg/png/bmp格式
];
}else{
$_data = [
'url'=>request()->domain().'/'.$_imgurl
];
}

$_res = json_decode(httpGet($_url,$_data),true);
//TODO 此處只返回false沒有終止,是因為程序執行流程需要,後期可能要改
if(isset($_res['error_msg'])) return false;
return $_res['words_result']['number'];
}

//獲取token
private function getToken(){
if(cache('_token')){
$_access_token = cache('_token');
}else{
$_url = 'https://aip.bce.com/oauth/2.0/token?grant_type=client_credentials&client_id='.$this->appKey.'&client_secret='.$this->secretKey;
$res = json_decode(httpGet($_url),true);
if(isset($res['error']))TApiException($res['error_description']);//終止程序並拋出異常
$_access_token = $res['access_token'];
$_expires_in = $res['expires_in'];
cache('_token',$_access_token,($_expires_in-1000));//我喜歡少存1000秒,沒有為什麼,問就是癖好
}
return $_access_token;
}
}

這是ThinkPhp5.1後端封裝的網路AI介面類,getToken()獲取憑證,getCarNumber()請求$_url 返回識別結果,這個是車牌號碼識別,車型識別等其他介面大部分都一樣,就換個請求地址$_url就行
//介面:
public function getImgCarNum(){
$_number = (new BaiDuAiBaseController())->getCarNumber(false,request()->param('img'));
return self::myShow('申請成功',['carNum'=>$_number]);
}
小程序端正常request請求上面的介面就行,下面是微信小程序拍照識別功能

//拍照
goImgSearch(){
uni.chooseImage({
count:1,
sizeType: ['compressed'],//original 原圖,compressed 壓縮
sourceType: ['album','camera'],//camera 相機 album相冊
success:(r)=>{
console.log(r)
//執行識別車牌號碼
this.img = r.tempFilePaths[0]
this.urlTobase64(r.tempFilePaths[0])
}
})
},
//識別車牌號碼
urlTobase64(url){
uni.showLoading({
title:'拚命識別車牌中..'
})
//#ifdef MP-WEIXIN
uni.getFileSystemManager().readFile({
filePath: url, //選擇圖片時返回的路徑
encoding: "base64",//這個是很重要的
success: res => { //成功的回調
//返回base64格式
let base64= 'data:image/jpeg;base64,' + res.data
//發送請求,識別車牌號碼
this.$H.post('/getImgCarNum',{
img:base64 //圖片數據
},{
token:true //必須登錄
}).then((res)=>{
console.log(res.carNum)
if(!res.carNum){
uni.hideLoading()
return uni.showModal({
title:'識別失敗',
content:'沒能識別到車牌號碼,請拍張清晰的圖片再試哦,謝謝',
showCancel:false
})
}
uni.showToast({
title:'識別車牌成功',
icon:'none'
})
this.searchUser = res.carNum
this.userCarNum = res.carNum
uni.hideLoading()
}).catch((e)=>{
uni.hideLoading()
return uni.showModal({
title:'識別失敗',
content:'沒能識別到車牌號碼,請拍張清晰的圖片再試哦,謝謝',
showCancel:false
})
})
},
fail:(e)=>{
console.log(e)
}
})
//#endif
},

Ⅳ 源碼編輯器AI怎麼做

源碼編輯器AI可以使用軟體進行編程即可。
在計算機科學中,人工智慧有時被稱為機器智能,是由機器展示的智能,與人類和動物展示的自然智能形成對比。
通俗地說,「人工智慧」一詞用來描述模仿人類與其他人類思維相關聯的「認知」功能的機器,如「學習」和「解決問題」。

Ⅳ 為什麼做AI的都選Python

答: 主要有以下的一些見解,歡迎和你探討。

  1. 主流的深度學習框架基本上都是用Python開發的,雖然說他們也提供了其他語言的介面,但是用起來還是沒有Python這么方便;
  2. Python裡面有非常多的科學計算包,各種具有實用功能的庫,大大提高了開發效率,對於AI而言,最開始呢是在學術上有著大量的運用,而使用Python,非常方便進行模擬。學術研究成功之後呢,慢慢在工業界越來越多了;
  3. Python的包裝能力,組合能力,嵌入式能力非常強,可以把各種復雜性包裝在 Python 模塊里,暴露出漂亮的介面。也非常方便其他語言的調用。

希望可以幫助到你~

熱點內容
電腦一周不用郵箱連接不到伺服器 發布:2025-07-27 01:07:34 瀏覽:449
手指速演算法二 發布:2025-07-27 01:07:30 瀏覽:699
蘋果壓縮z 發布:2025-07-27 01:05:54 瀏覽:470
哪些設備需要雙重化配置保護 發布:2025-07-27 01:03:37 瀏覽:363
javawsdlwebservice 發布:2025-07-27 00:59:23 瀏覽:326
多項式求和的存儲表達方式畫圖 發布:2025-07-27 00:57:45 瀏覽:728
鋁壓縮曲線 發布:2025-07-27 00:48:16 瀏覽:563
修改ftp主動模式 發布:2025-07-27 00:48:01 瀏覽:856
java查看環境變數 發布:2025-07-27 00:45:47 瀏覽:18
php文件結構 發布:2025-07-27 00:44:19 瀏覽:675