Skip to content

Commit c24a68f

Browse files
committed
Add more review feedback
1 parent cb042c1 commit c24a68f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/dev-guide/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ All Metalhead.jl model artifacts are hosted using HuggingFace. You can find the
3535
6. Open a PR to the [corresponding HuggingFace repo](https://huggingface.co/FluxML). Do this by going to the "Community" tab in the HuggingFace repository. PRs and discussions are shown as the same thing in the HuggingFace web app. You can use your local Git program to make clone the repo and make PRs if you wish. Check out the [guide on PRs to HuggingFace](https://huggingface.co/docs/hub/repositories-pull-requests-discussions) for more information.
3636
7. Copy the download URL for the model file that you added to HuggingFace. Make sure to grab the URL for a specific commit and not for the `main` branch.
3737
8. Update your Metalhead.jl PR by adding the URL to the Artifacts.toml.
38-
9. If the tests pass for your weights, we will merge your PR!
38+
9. If the tests pass for your weights, we will merge your PR! Your model should pass the `acctest` function in the Metalhead.jl test suite. If your model already exists in the repo, then these tests are already in place, and you can add your model configuration to the `PRETRAINED_MODELS` list in the `runtests.jl` file. Please refer to the ResNet tests as an example.
3939

4040
If you want to fix existing weights, then you can follow the same set of steps.

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function gradtest(model, input)
2323
return true
2424
end
2525

26-
function normalize(data)
26+
function normalize_imagenet(data)
2727
cmean = reshape(Float32[0.485, 0.456, 0.406],(1,1,3,1))
2828
cstd = reshape(Float32[0.229, 0.224, 0.225],(1,1,3,1))
2929
return (data .- cmean) ./ cstd
@@ -33,7 +33,7 @@ end
3333
const TEST_PATH = download("https://cdn.pixabay.com/photo/2015/05/07/11/02/guitar-756326_960_720.jpg")
3434
const TEST_IMG = imresize(Images.load(TEST_PATH), (224, 224))
3535
# CHW -> WHC
36-
const TEST_X = permutedims(convert(Array{Float32}, channelview(TEST_IMG)), (3,2,1)) |> normalize
36+
const TEST_X = permutedims(convert(Array{Float32}, channelview(TEST_IMG)), (3,2,1)) |> normalize_imagenet
3737

3838
# image net labels
3939
const TEST_LBLS = readlines(download("https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt"))

0 commit comments

Comments
 (0)