Evan Shelhamer
f8b612d8cd
default raw_scale in python scripts to ImageNet model value
2014-08-09 20:43:40 -07:00
Evan Shelhamer
b97b88f0c2
LICENSE governs the whole project so strip file headers
2014-08-06 18:35:29 -07:00
Evan Shelhamer
0db94786a7
drop np.asarray() in favor of declaration (~1.75x speedup)
2014-08-05 23:17:59 -07:00
Evan Shelhamer
4f7726916c
fix pycaffe context cropping with or without mean
2014-08-05 23:17:59 -07:00
Evan Shelhamer
e1b3413708
take array in pycaffe `Net.set_mean()` instead of file path
2014-08-05 23:17:59 -07:00
Evan Shelhamer
d5c3cef471
fix pycaffe input processing
...
- load an image as [0,1] single / np.float32 according to Python convention
- fix input scaling during preprocessing:
- scale input for preprocessing by `raw_scale` e.g. to map an image
to [0, 255] for the CaffeNet and AlexNet ImageNet models
- scale feature space by `input_scale` after mean subtraction
- switch examples to raw scale for ImageNet models
- fix #525
- preserve type after resizing.
- resize 1, 3, or K channel images with special casing between
skimage.transform (1 and 3) and scipy.ndimage (K) for speed
2014-08-05 23:17:59 -07:00
Evan Shelhamer
99f27fc082
define caffe.Net input preprocessing members by boost::python
...
define `Net.{mean, input_scale, channel_swap}` on the boost::python side
so that the members always exist. drop ugly initialization logic.
2014-08-05 15:55:45 -07:00
Evan Shelhamer
d842f4a24f
Merge pull request #733 from longjon/pycaffe-tweaks
...
pycaffe fixes
2014-07-28 14:14:03 -07:00
Jonathan L Long
fb2f7c1c27
pycaffe: test channel_order and input_scale against None
...
An input_scale of zero should produce warnings/errors/infinities rather
than being the same as an input_scale of one. A channel_order of () or 0
should not be equivalent to the default ordering.
2014-07-18 17:08:49 -07:00
Jonathan L Long
32fefa96f9
pycaffe: reorder exceptions
...
It doesn't make sense to complain about input not being batch-sized if
it isn't even 4-d in the first place.
2014-07-18 17:08:49 -07:00
Jonathan L Long
fc48d5de5c
pycaffe: allow unspecified mean. Fixes #671 .
2014-07-18 17:08:49 -07:00
Jonathan L Long
3ef43e41e7
pycaffe: expose Forward/Backward From/To as kwargs start and end
2014-07-18 15:39:55 -07:00
Evan Shelhamer
506e476047
Merge pull request #455 from shelhamer/pycaffe-save
...
Save from python for net surgery
2014-06-12 16:00:49 -07:00
Evan Shelhamer
6a5b2c19c7
save from python for net surgery
...
0. Scheme desired parameters.
1. Do surgery on the net through `net.params['name'][idx].data[...] = `.
2. Save post-operation net params by `net.save('fname')`.
Handwoven deep nets, anyone?
2014-06-12 14:27:36 -07:00
Evan Shelhamer
a7e397abbd
Merge pull request #482 from shelhamer/rcnn-detector-example
...
Make R-CNN the Caffe detection example
2014-06-11 15:22:04 -07:00
Evan Shelhamer
8dc270e691
pycaffe: leave grayscale images gray according to arg
2014-06-11 10:17:17 -07:00
Evan Shelhamer
206bf86872
make selective search proposals with R-CNN configuration
2014-06-09 21:06:18 -07:00
Evan Shelhamer
4992abecec
pycaffe Detector crops with surrounding context
...
- caffe.Detector learned how to crop windows with context in the R-CNN
style s.t. the bordero of the network input is a given amount of
context.
- add --context_pad arg to detect.py for amount of context. Default is
16, as in R-CNN.
2014-06-09 18:14:25 -07:00
Evan Shelhamer
a57b8d5b40
fix old detect.py default
2014-06-09 18:14:25 -07:00
Evan Shelhamer
8c609da736
caffe.Net preprocessing members belong to object, not class
2014-05-26 21:50:39 -07:00
Evan Shelhamer
211c3c29bb
follow-up on #443 to invert k channels (instead of 3)
2014-05-23 09:21:17 -07:00
James Thewlis
e5fcf030fb
Correctly invert the swapping of colour channels
...
In the 'deprocess' method, get back the image with the original channel order
by inverting the original transform, rather than reversing the tuple which is
incorrect.
2014-05-23 09:21:17 -07:00
Evan Shelhamer
1cb6feaf5a
fix draw_net python script
...
include caffe.draw for drawing functions.
2014-05-22 01:02:56 -07:00
Evan Shelhamer
8830dc5b81
preprocess single inputs instead of lists
...
For compositionality and expectations.
2014-05-20 11:42:41 -07:00
Evan Shelhamer
02ecf1dacf
windowed detection in python
2014-05-20 11:42:41 -07:00
Evan Shelhamer
111df0ecfc
squash infuriating loop assignment bug in batching
2014-05-19 23:56:48 -07:00
Evan Shelhamer
2fc32d558a
image classification in python
2014-05-19 23:56:48 -07:00
Evan Shelhamer
bf4d7262bd
fix padding for the last batch
2014-05-19 23:56:16 -07:00
Evan Shelhamer
6b85fd006d
split drawnet into module code and script
...
Don't run scripts in the module dir to avoid import collisions between
io and caffe.io.
2014-05-19 23:55:22 -07:00
Evan Shelhamer
50d0b6d9c6
add caffe.io submodule for conversions, image loading and resizing
2014-05-19 23:55:21 -07:00
Evan Shelhamer
738c8758e3
fix python mean subtraction
2014-05-19 23:54:25 -07:00
Evan Shelhamer
37123a5126
drop cute names in favor of Net.{pre,de}process() for input formatting
...
...and refer to inputs as inputs and not images since general vectors
and matrices are perfectly fine.
2014-05-16 16:10:25 -07:00
Evan Shelhamer
51024131cc
Net.caffeinate() and Net.decaffeinate() format/unformat lists
2014-05-16 16:10:25 -07:00
Evan Shelhamer
5d584c27f0
take blob args as ndarrays and assign on the python side
...
Take blob args and give blob returns as single ndarrays instead of lists
of arrays.
Assign the net blobs and diffs as needed on the python side, which
reduces copies and simplifies the C++ side of the wrapper.
Thanks @longjon for the suggestion.
2014-05-16 16:10:25 -07:00
Evan Shelhamer
025c64e71d
resize to input dimensions when formatting in python
2014-05-15 13:52:53 -07:00
Evan Shelhamer
459c8c1dac
replace iterator with indices for consistency
2014-05-15 13:06:17 -07:00
Evan Shelhamer
a7f6750cc3
python style
2014-05-15 12:35:32 -07:00
Evan Shelhamer
a3b307a385
fix accidental revert of Init() from f5c28581
2014-05-15 10:20:43 -07:00
Evan Shelhamer
1b23680244
batch inputs in python by forward_all() and forward_backward_all()
2014-05-14 23:48:01 -07:00
Evan Shelhamer
8af33e8ca2
don't squeeze blob arrays for python
...
Preserve the non-batch dimensions of blob arrays, even for singletons.
The forward() and backward() helpers take lists of ndarrays instead of a
single ndarray per blob, and lists of ndarrays are likewise returned.
Note that for output the blob array could actually be returned as a
single ndarray instead of a list.
2014-05-14 20:17:16 -07:00
Evan Shelhamer
af0b857d54
python forward() and backward() extract any blobs and diffs
2014-05-14 20:14:55 -07:00
Evan Shelhamer
ac5e6fa1ce
python Net.backward() helper and Net.BackwardPrefilled()
2014-05-14 14:37:33 -07:00
Evan Shelhamer
9d4324e5e7
bad forward/backward inputs throw exceptions instead of crashing python
2014-05-14 14:02:54 -07:00
Evan Shelhamer
0e5a5cf50e
pycaffe Net.forward() helper
...
Do forward pass by prefilled or packaging input + output blobs and
returning a {output blob name: output list} dict.
2014-05-14 13:44:02 -07:00
Evan Shelhamer
96cd02dd53
set input preprocessing per blob in python
2014-05-14 13:44:02 -07:00
Evan Shelhamer
56ca978c4e
expose input and output blob names to python as lists
2014-05-14 13:44:02 -07:00
Evan Shelhamer
872ddf3f81
pycaffe comments, lint
2014-05-13 18:10:42 -07:00
Evan Shelhamer
8da2a3209c
add python io getters, mean helper, and image caffeinator/decaffeinator
2014-05-13 18:10:41 -07:00
Evan Shelhamer
47ec9ace41
make python wrapper mean match binaryproto dimensions
...
ilsvrc_2012_mean.npy has dims K x H x W.
Code written for the old D x D x K mean needs to be rewritten!
2014-05-13 18:10:41 -07:00
Evan Shelhamer
51f276e6b2
match existing python formatting
2014-05-13 18:10:41 -07:00