Skip to content

Commit

Permalink
feat: Support 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wormtql committed Aug 20, 2023
1 parent 27b67f0 commit 23091b7
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yas_scanner"
version = "0.1.13"
version = "0.1.14"
edition = "2018"
build = "build.rs"
description = "Genshin Impact item scanner"
Expand Down
3 changes: 0 additions & 3 deletions models/model_acc100-epoch16.onnx

This file was deleted.

3 changes: 3 additions & 0 deletions models/model_training.onnx
Git LFS file not shown
16 changes: 16 additions & 0 deletions src/artifact/internal_artifact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ pub enum ArtifactSetName {
DesertPavilionChronicle,
NymphsDream,
VourukashasGlow,
MarechausseeHunter,
GoldenTroupe,
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -230,6 +232,8 @@ pub fn get_real_artifact_name_chs(raw: &str) -> Option<String> {
"众王之都的开端", "黄金邦国的结末", "失落迷途的机芯", "迷醉长梦的守护", "流沙贵嗣的遗宝",
"恶龙的单片镜", "坏巫师的羽杖", "旅途中的鲜花", "水仙的时时刻刻", "勇者们的茶会",
"灵光明烁之心", "琦色灵彩之羽", "灵光源起之蕊", "久远花落之时", "无边酣乐之筵",
"老兵的容颜", "杰作的序曲", "猎人的胸花", "裁判的时刻", "遗忘的容器",
"黄金剧团的奖赏", "黄金飞鸟的落羽", "黄金乐曲的变奏", "黄金时代的先声", "黄金之夜的喧嚣",
];

let mut min_index = 0;
Expand Down Expand Up @@ -441,6 +445,8 @@ impl ArtifactSetName {
"众王之都的开端" | "黄金邦国的结末" | "失落迷途的机芯" | "迷醉长梦的守护" | "流沙贵嗣的遗宝" => Some(ArtifactSetName::DesertPavilionChronicle),
"恶龙的单片镜" | "坏巫师的羽杖" | "旅途中的鲜花" | "水仙的时时刻刻" | "勇者们的茶会" => Some(ArtifactSetName::NymphsDream),
"灵光明烁之心" | "琦色灵彩之羽" | "灵光源起之蕊" | "久远花落之时" | "无边酣乐之筵" => Some(ArtifactSetName::VourukashasGlow),
"猎人的胸花" | "杰作的序曲" | "裁判的时刻" | "遗忘的容器" | "老兵的容颜" => Some(ArtifactSetName::MarechausseeHunter),
"黄金乐曲的变奏" | "黄金飞鸟的落羽" | "黄金时代的先声" | "黄金之夜的喧嚣" | "黄金剧团的奖赏" => Some(ArtifactSetName::GoldenTroupe),
_ => None,
}
}
Expand Down Expand Up @@ -664,6 +670,16 @@ impl ArtifactSlot {
"久远花落之时" => Some(ArtifactSlot::Sand),
"无边酣乐之筵" => Some(ArtifactSlot::Goblet),
"灵光明烁之心" => Some(ArtifactSlot::Head),
"猎人的胸花" => Some(ArtifactSlot::Flower),
"杰作的序曲" => Some(ArtifactSlot::Feather),
"裁判的时刻" => Some(ArtifactSlot::Sand),
"遗忘的容器" => Some(ArtifactSlot::Goblet),
"老兵的容颜" => Some(ArtifactSlot::Head),
"黄金乐曲的变奏" => Some(ArtifactSlot::Flower),
"黄金飞鸟的落羽" => Some(ArtifactSlot::Feather),
"黄金时代的先声" => Some(ArtifactSlot::Sand),
"黄金之夜的喧嚣" => Some(ArtifactSlot::Goblet),
"黄金剧团的奖赏" => Some(ArtifactSlot::Head),
_ => None,
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/common/character_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ lazy_static! {
set.insert(String::from("艾尔海森"));
set.insert(String::from("迪希雅"));
set.insert(String::from("米卡"));
set.insert(String::from("琳妮特"));
set.insert(String::from("林尼"));
set.insert(String::from("菲米尼"));
set.insert(String::from("芙宁娜"));
set.insert(String::from("那维莱特"));
set.insert(String::from("娜维娅"));

set
};
Expand Down
2 changes: 2 additions & 0 deletions src/expo/good.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ impl ArtifactSetName {
ArtifactSetName::DesertPavilionChronicle => "DesertPavilionChronicle",
ArtifactSetName::NymphsDream => "NymphsDream",
ArtifactSetName::VourukashasGlow => "VourukashasGlow",
ArtifactSetName::MarechausseeHunter => "MarechausseeHunter",
ArtifactSetName::GoldenTroupe => "GoldenTroupe",
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/expo/mingyu_lab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ impl ArtifactSetName {
ArtifactSetName::DesertPavilionChronicle => "desert_pavilion_chronicle",
ArtifactSetName::NymphsDream => "nymphs_dream",
ArtifactSetName::VourukashasGlow => "vourukashas_glow",
ArtifactSetName::MarechausseeHunter => "marechaussee_hunter",
ArtifactSetName::GoldenTroupe => "golden_troupe",

// Not supported by Mingyulab
ArtifactSetName::Adventurer => unreachable!(),
Expand Down
4 changes: 2 additions & 2 deletions src/inference/inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ impl CRNNModel {
// .with_input_fact(0, InferenceFact::dt_shape(f32::datum_type(), tvec!(1, 1, 32, 384))).unwrap()
// .into_optimized().unwrap()
// .into_runnable().unwrap();
let mut bytes = include_bytes!("../../models/model_acc100-epoch16.onnx");
// let mut bytes = include_bytes!("../../models/model_training.onnx");
// let mut bytes = include_bytes!("../../models/model_acc100-epoch16.onnx");
let mut bytes = include_bytes!("../../models/model_training.onnx");

let model = tract_onnx::onnx()
.model_for_read(&mut bytes.as_bytes()).unwrap()
Expand Down

0 comments on commit 23091b7

Please sign in to comment.