/** * Produce a {@link LocalFeatureList} of {@link FloatLocalFeatureAdaptor} by * wrapping the input list, and dynamically wrapping with the * {@link FloatLocalFeatureAdaptor}s on demand. * * @param list * the input list * @return the wrapped list */ public static <L extends Location> List<FloatLocalFeatureAdaptor<L>> wrap( final List<? extends LocalFeature<L, ?>> list) { return wrap(list, null); }
/** * Produce a {@link LocalFeatureList} of {@link FloatLocalFeatureAdaptor} by * wrapping the input list, and dynamically wrapping with the * {@link FloatLocalFeatureAdaptor}s on demand. * * @param list * the input list * @return the wrapped list */ public static <L extends Location> List<FloatLocalFeatureAdaptor<L>> wrap( final List<? extends LocalFeature<L, ?>> list) { return wrap(list, null); }
/** * Load the raw features and create VLAD representations. * * @return * @throws IOException */ private static Map<Document, FloatFV> getVLADFeatures() throws IOException { final Map<Document, FloatFV> vladData = new HashMap<Document, FloatFV>(); final FloatCentroidsResult centroids = readFvecs(new File( "/Users/jsh2/Downloads/cvpr2010/data/clust_k64.fvecs")); final ExactFloatAssigner assigner = new ExactFloatAssigner(centroids); final VLAD<float[]> vlad = new VLAD<float[]>(assigner, centroids, true); for (final File f : new File("/Users/jsh2/Downloads/siftgeo/").listFiles()) { System.out.println("Loading " + f.getName()); final LocalFeatureList<SIFTGeoKeypoint> keys = SIFTGeoKeypoint.read(f); final List<FloatLocalFeatureAdaptor<SIFTGeoLocation>> fkeys = FloatLocalFeatureAdaptor.wrap(keys); final MultidimensionalFloatFV fv = vlad.aggregate(fkeys); vladData.put(new Document(f.getName()), fv); } return vladData; }
/** * Load the raw features and create VLAD representations. * * @return * @throws IOException */ private static Map<Document, FloatFV> getVLADFeatures() throws IOException { final Map<Document, FloatFV> vladData = new HashMap<Document, FloatFV>(); final FloatCentroidsResult centroids = readFvecs(new File( "/Users/jsh2/Downloads/cvpr2010/data/clust_k64.fvecs")); final ExactFloatAssigner assigner = new ExactFloatAssigner(centroids); final VLAD<float[]> vlad = new VLAD<float[]>(assigner, centroids, true); for (final File f : new File("/Users/jsh2/Downloads/siftgeo/").listFiles()) { System.out.println("Loading " + f.getName()); final LocalFeatureList<SIFTGeoKeypoint> keys = SIFTGeoKeypoint.read(f); final List<FloatLocalFeatureAdaptor<SIFTGeoLocation>> fkeys = FloatLocalFeatureAdaptor.wrap(keys); final MultidimensionalFloatFV fv = vlad.aggregate(fkeys); vladData.put(new Document(f.getName()), fv); } return vladData; }
final LocalFeatureList<SIFTGeoKeypoint> keys = SIFTGeoKeypoint.read(f); final List<FloatLocalFeatureAdaptor<SIFTGeoLocation>> fkeys = FloatLocalFeatureAdaptor.wrap(keys);
final LocalFeatureList<SIFTGeoKeypoint> keys = SIFTGeoKeypoint.read(f); final List<FloatLocalFeatureAdaptor<SIFTGeoLocation>> fkeys = FloatLocalFeatureAdaptor.wrap(keys);