Short Description
Define feature extraction function in Jython or CPython (through Exenet)Documentation
Feature Extraction Function in python
Update: Support CPython
By using "Jython execnet for Icy", we now can write CPython code to do feature extraction. To using this feature,
you should install python and numpy.
To define a usable feature extraction function, you need to define a function named "process".
It should be defined like this:
def process(input, position):
output = input
# do something here with output
return output
FFT Example
from org.python.modules import jarray
from edu.emory.mathcs.jtransforms.fft import DoubleFFT_1D
from java.lang import Math
import copy
def process(input, position):
size = len(input)
output = copy.deepcopy(input)
fft = DoubleFFT_1D(size)
fft.realForward(output)
for j in range(size/2):
output[j]= Math.sqrt(Math.pow(output[2*j],2)+Math.pow(output[2*j+1],2));
return output[:len(input)/2]
Template Library
In order to show the scripts in the library, you need to name the file with the pattern "CPython_XXXXXX.py" or "Jython_XXXXXX.py",
replace XXXXXX with your own name.
if your code is Jython code, you should use "Jython_XXXXXX.py" a naming rule, otherwise, you should use "CPython_XXXXXX.py".