Skip to content

Commit 42aafee

Browse files
authored
Update docs on building from source (keras-team#1312)
1 parent 11283f3 commit 42aafee

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,15 @@ jobs:
6464
- name: Bazel Build
6565
if: ${{ ! matrix.use-macos-arm }}
6666
run: |
67+
export BUILD_WITH_CUSTOM_OPS=true
6768
bazel build build_pip_pkg
6869
- name: Bazel Build (MacOS ARM)
6970
if: ${{ matrix.use-macos-arm}}
7071
run: |
7172
bazel build --cpu=darwin_arm64 --copt -mmacosx-version-min=12.0 --linkopt -mmacosx-version-min=12.0 build_pip_pkg
7273
- name: Build wheels
7374
run: |
75+
export BUILD_WITH_CUSTOM_OPS=true
7476
bazel-bin/build_pip_pkg wheels
7577
- name: Repair wheels (manylinux)
7678
if: ${{ matrix.os == 'ubuntu-18.04' }}

README.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,27 @@ Thank you to all of our wonderful contributors!
6666
<img src="https://contrib.rocks/image?repo=keras-team/keras-cv" />
6767
</a>
6868

69+
## Pretrained Weights
70+
Many models in KerasCV come with pre-trained weights. With the exception of StableDiffusion,
71+
all of these weights are trained using Keras and KerasCV components and training scripts in this
72+
repository. Models may not be trained with the same parameters or preprocessing pipeline
73+
described in their original papers. Performance metrics for pre-trained weights can be found
74+
in the training history for each task. For example, see ImageNet classification training
75+
history for backbone models [here](examples/training/classification/imagenet/training_history.json).
76+
All results are reproducible using the training scripts in this repository. Pre-trained weights
77+
operate on images that have been rescaled using a simple `1/255` rescaling layer.
78+
79+
## Custom Ops
80+
Note that in some the 3D Object Detection layers, custom TF ops are used. The
81+
binaries for these ops are not shipped in our PyPi package in order to keep our
82+
wheels pure-Python.
6983

70-
## Installing Custom Ops from Source
84+
If you'd like to use these custom ops, you can install from source using the
85+
instructions below.
86+
87+
### Installing KerasCV with Custom Ops from Source
7188
Installing from source requires the [Bazel](https://bazel.build/) build system
72-
(version >= 1.0.0).
89+
(version >= 5.4.0).
7390

7491
```
7592
git clone https://github.com/keras-team/keras-cv.git
@@ -78,20 +95,16 @@ cd keras-cv
7895
python3 build_deps/configure.py
7996
8097
bazel build build_pip_pkg
98+
export BUILD_WITH_CUSTOM_OPS=true
8199
bazel-bin/build_pip_pkg wheels
82100
83101
pip install wheels/keras_cv-*.whl
84102
```
85103

86-
## Pretrained Weights
87-
Many models in KerasCV come with pre-trained weights. With the exception of StableDiffusion,
88-
all of these weights are trained using Keras and KerasCV components and training scripts in this
89-
repository. Models may not be trained with the same parameters or preprocessing pipeline
90-
described in their original papers. Performance metrics for pre-trained weights can be found
91-
in the training history for each task. For example, see ImageNet classification training
92-
history for backbone models [here](examples/training/classification/imagenet/training_history.json).
93-
All results are reproducible using the training scripts in this repository. Pre-trained weights
94-
operate on images that have been rescaled using a simple `1/255` rescaling layer.
104+
Note that GitHub actions exist to release KerasCV with custom ops, but are
105+
currently disabled. You can use these [actions](https://github.com/keras-team/keras-cv/blob/master/.github/workflows/release.yml)
106+
in your own fork to create wheels for Linux (manylinux2014), MacOS (both x86 and ARM),
107+
and Windows.
95108

96109
## Disclaimer
97110

@@ -109,7 +122,7 @@ Here is the BibTeX entry:
109122
```bibtex
110123
@misc{wood2022kerascv,
111124
title={KerasCV},
112-
author={Wood, Luke and Tan, Zhenyu and Ian, Stenbit and Zhu, Scott and Chollet, Fran\c{c}ois and others},
125+
author={Wood, Luke and Tan, Zhenyu and Stenbit, Ian and Zhu, Scott and Chollet, Fran\c{c}ois and others},
113126
year={2022},
114127
howpublished={\url{https://github.com/keras-team/keras-cv}},
115128
}

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
from setuptools import setup
2222
from setuptools.dist import Distribution
2323

24-
BUILD_WITH_CUSTOM_OPS = not (
24+
BUILD_WITH_CUSTOM_OPS = (
2525
"BUILD_WITH_CUSTOM_OPS" in os.environ
26-
and os.environ["BUILD_WITH_CUSTOM_OPS"] == "false"
26+
and os.environ["BUILD_WITH_CUSTOM_OPS"] == "true"
2727
)
2828

2929
HERE = pathlib.Path(__file__).parent

0 commit comments

Comments
 (0)