diff --git a/cineast-core/src/main/java/org/vitrivr/cineast/core/features/ObjectInstances.java b/cineast-core/src/main/java/org/vitrivr/cineast/core/features/ObjectInstances.java deleted file mode 100644 index 772afdace..000000000 --- a/cineast-core/src/main/java/org/vitrivr/cineast/core/features/ObjectInstances.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.vitrivr.cineast.core.features; - -import java.util.List; -import org.vitrivr.cineast.core.config.ReadableQueryConfig; -import org.vitrivr.cineast.core.data.score.ScoreElement; -import org.vitrivr.cineast.core.data.segments.SegmentContainer; -import org.vitrivr.cineast.core.features.abstracts.AbstractFeatureModule; - - -public class ObjectInstances extends AbstractFeatureModule { - - public static final String TABLE_NAME = "features_ObjectInstances"; - public static final int VECTOR_LENGTH = 512; - - public ObjectInstances() { - super(TABLE_NAME, 1000f, //TODO figure out proper value - VECTOR_LENGTH); - } - - @Override - public void processSegment(SegmentContainer shot) { - //TODO implement extraction - throw new UnsupportedOperationException(); - } - - @Override - public List getSimilar(SegmentContainer sc, ReadableQueryConfig qc) { - //TODO implement extraction - throw new UnsupportedOperationException(); - } -} diff --git a/cineast-runtime/src/main/java/org/vitrivr/cineast/standalone/cli/ImportCommand.java b/cineast-runtime/src/main/java/org/vitrivr/cineast/standalone/cli/ImportCommand.java index 1e1775247..31276ed2f 100644 --- a/cineast-runtime/src/main/java/org/vitrivr/cineast/standalone/cli/ImportCommand.java +++ b/cineast-runtime/src/main/java/org/vitrivr/cineast/standalone/cli/ImportCommand.java @@ -27,7 +27,6 @@ import org.vitrivr.cineast.standalone.importer.vbs2019.AudioTranscriptImportHandler; import org.vitrivr.cineast.standalone.importer.vbs2019.CaptionTextImportHandler; import org.vitrivr.cineast.standalone.importer.vbs2019.GoogleVisionImportHandler; -import org.vitrivr.cineast.standalone.importer.vbs2019.MLTFeaturesImportHandler; import org.vitrivr.cineast.standalone.importer.vbs2019.ObjectMetadataImportHandler; import org.vitrivr.cineast.standalone.importer.vbs2019.TagImportHandler; import org.vitrivr.cineast.standalone.importer.vbs2019.gvision.GoogleVisionCategory; @@ -61,7 +60,7 @@ public class ImportCommand implements Runnable { @Override public void run() { - System.out.println(String.format("Starting import of type %s for '%s'.", this.type, this.input)); + System.out.printf("Starting import of type %s for '%s'.%n", this.type, this.input); final Path path = Paths.get(this.input); final ImportType type = ImportType.valueOf(this.type.toUpperCase()); DataImportHandler handler = null; @@ -102,9 +101,6 @@ public void run() { /* Be aware that this is metadata which might already be comprised in merged vbs metadata */ handler = new ColorlabelImportHandler(this.threads, this.batchsize); break; - case OBJECTINSTANCE: - handler = new MLTFeaturesImportHandler(this.threads, this.batchsize, this.clean); - break; case LSCMETA: handler = new MetaImportHandler(this.threads, this.batchsize, this.clean); break; @@ -165,6 +161,6 @@ private void doVisionImport(Path path) { * Enum of the available types of data imports. */ private enum ImportType { - PROTO, JSON, LIRE, ASR, OCR, AUDIO, TAGS, METADATA, CAPTIONING, GOOGLEVISION, V3C1COLORLABELS, OBJECTINSTANCE, LSCMETA, LSCCONCEPT, LSCCAPTION, LSCX, LSCTABLE, LSCTAGSALL, LSCOCR, LSCSPATIAL, LSC21TAGS + PROTO, JSON, LIRE, ASR, OCR, AUDIO, TAGS, METADATA, CAPTIONING, GOOGLEVISION, V3C1COLORLABELS, LSCMETA, LSCCONCEPT, LSCCAPTION, LSCX, LSCTABLE, LSCTAGSALL, LSCOCR, LSCSPATIAL, LSC21TAGS } } diff --git a/cineast-runtime/src/main/java/org/vitrivr/cineast/standalone/importer/vbs2019/MLTFeaturesImportHandler.java b/cineast-runtime/src/main/java/org/vitrivr/cineast/standalone/importer/vbs2019/MLTFeaturesImportHandler.java deleted file mode 100644 index 0af396a8c..000000000 --- a/cineast-runtime/src/main/java/org/vitrivr/cineast/standalone/importer/vbs2019/MLTFeaturesImportHandler.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.vitrivr.cineast.standalone.importer.vbs2019; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.vitrivr.cineast.core.db.setup.EntityCreator; -import org.vitrivr.cineast.core.features.ObjectInstances; -import org.vitrivr.cineast.core.util.LogHelper; -import org.vitrivr.cineast.standalone.config.Config; -import org.vitrivr.cineast.standalone.importer.handlers.DataImportHandler; - -public class MLTFeaturesImportHandler extends DataImportHandler { - - private static final Logger LOGGER = LogManager.getLogger(); - - public MLTFeaturesImportHandler(int threads, int batchsize, boolean clean) { - super(threads, batchsize); - if (clean) { - final EntityCreator ec = Config.sharedConfig().getDatabase().getEntityCreatorSupplier().get(); - LOGGER.info("Dropping table {}", ObjectInstances.TABLE_NAME); - ec.dropEntity(ObjectInstances.TABLE_NAME); - LOGGER.info("Re-creating table {}", ObjectInstances.TABLE_NAME); - ec.createFeatureEntity(ObjectInstances.TABLE_NAME, true, ObjectInstances.VECTOR_LENGTH); - ec.close(); - } - } - - @Override - public void doImport(Path root) { - try { - LOGGER.info("Starting data import for mlt feature files in: {}", root.toString()); - Files.walk(root, 2).filter(p -> p.toString().toLowerCase().endsWith(".csv")).forEach(p -> { - try { - this.futures.add(this.service.submit(new DataImportRunner(new MLTFeatureImporter(p), ObjectInstances.TABLE_NAME, "mlt feature file"))); - } catch (IOException e) { - LOGGER.fatal("Failed to open path at {} ", p); - throw new RuntimeException(e); - } - }); - } catch (IOException e) { - LOGGER.error("Could not start data import process with path '{}' due to an IOException: {}. Aborting...", root.toString(), LogHelper.getStackTrace(e)); - } - } -}