-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup fix predict_f16 which had the wrong word size fix missing prediction add example move ug
- Loading branch information
Micah Chambers (eos)
committed
Jan 28, 2025
1 parent
a19cf37
commit 54bd86f
Showing
5 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
extern crate tiff; | ||
|
||
use tiff::decoder::{ifd, Decoder, DecodingResult}; | ||
use tiff::tags::Tag; | ||
use tiff::ColorType; | ||
|
||
use std::fs::File; | ||
use std::path::PathBuf; | ||
|
||
const TEST_IMAGE_DIR: &str = "./tests/images/"; | ||
|
||
#[test] | ||
fn test_ieee_fp16() { | ||
let filenames = ["example_fp16.tif"]; | ||
|
||
for filename in filenames.iter() { | ||
let path = PathBuf::from(TEST_IMAGE_DIR).join(filename); | ||
let img_file = File::open(path).expect("Cannot find test image!"); | ||
let mut decoder = Decoder::new(img_file).expect("Cannot create decoder"); | ||
assert_eq!( | ||
decoder.dimensions().expect("Cannot get dimensions"), | ||
(513, 513) | ||
); | ||
assert_eq!( | ||
decoder.colortype().expect("Cannot get colortype"), | ||
ColorType::Gray(16) | ||
); | ||
if let DecodingResult::F16(img_res) = decoder.read_image().unwrap() { | ||
//assert_eq!(image_data, img_res); | ||
} else { | ||
panic!("Wrong data type"); | ||
} | ||
} | ||
} |