Views
No views yet
timm/xception41.tf_in1k for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.XceptionImageClassify / XceptionModel).1import os
2
3os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
4
5from PIL import Image
6from zeromodels.models.xception import XceptionImageClassify, XceptionModel, XceptionImageProcessor
7
8model = XceptionImageClassify.from_weights("zeromodels/xception41_tf_in1k")
9processor = XceptionImageProcessor.from_weights("zeromodels/xception41_tf_in1k")
10
11image = Image.open("your_image.jpg").convert("RGB")
12pixels = processor(image) # resize + normalize (normalization lives in the processor)
13logits = model(pixels, training=False)
14print(logits.shape) # (1, num_classes)
15
16# Feature extraction: the backbone without the classifier head
17backbone = XceptionModel.from_weights("zeromodels/xception41_tf_in1k", as_backbone=True)
18features = backbone(pixels, training=False)from_weights("zeromodels/<variant>"):| Variant | Hub |
|---|---|
xception41_tf_in1k | zeromodels/xception41_tf_in1k |
xception41p_ra3_in1k | zeromodels/xception41p_ra3_in1k |
xception65_ra3_in1k | zeromodels/xception65_ra3_in1k |
xception65_tf_in1k | zeromodels/xception65_tf_in1k |
xception65p_ra3_in1k | zeromodels/xception65p_ra3_in1k |
xception71_tf_in1k | zeromodels/xception71_tf_in1k |
KERAS_BACKEND before importing Keras / zeromodels.XceptionImageClassify returns class logits; XceptionModel returns features (as_backbone=True for multi-scale stages).XceptionImageClassify.from_weights("hf:timm/xception41.tf_in1k").license (usually matches the upstream checkpoint).