Commit 7994cffd authored by Marek Horský's avatar Marek Horský Committed by Radek Ošlejšek
Browse files

Resolve "Implement UI element for batch registration algorithm selection"

parent 8cea89d7
Loading
Loading
Loading
Loading
+46 −15
Original line number Diff line number Diff line
@@ -30,11 +30,15 @@
                      <EmptySpace max="-2" attributes="0"/>
                      <Component id="jPanel2" max="32767" attributes="0"/>
                  </Group>
                  <Component id="jPanel3" alignment="0" max="32767" attributes="0"/>
                  <Group type="102" attributes="0">
                      <Group type="103" groupAlignment="0" attributes="0">
                          <Component id="jPanel3" alignment="0" min="-2" max="-2" attributes="0"/>
                          <Group type="102" alignment="0" attributes="0">
                              <Component id="jButton1" min="-2" max="-2" attributes="0"/>
                              <EmptySpace max="-2" attributes="0"/>
                              <Component id="jButton5" min="-2" max="-2" attributes="0"/>
                          </Group>
                      </Group>
                      <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
                  </Group>
              </Group>
@@ -59,7 +63,7 @@
                  <Component id="jButton5" min="-2" max="-2" attributes="0"/>
                  <Component id="jButton1" alignment="0" min="-2" max="-2" attributes="0"/>
              </Group>
              <EmptySpace pref="101" max="32767" attributes="0"/>
              <EmptySpace pref="111" max="32767" attributes="0"/>
          </Group>
      </Group>
    </DimensionLayout>
@@ -282,29 +286,36 @@
      <Layout>
        <DimensionLayout dim="0">
          <Group type="103" groupAlignment="0" attributes="0">
              <Group type="102" attributes="0">
                  <EmptySpace max="-2" attributes="0"/>
              <Group type="102" alignment="0" attributes="0">
                  <EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="0" attributes="0">
                      <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel8" min="-2" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="0" attributes="0">
                      <Component id="jCheckBox4" min="-2" max="-2" attributes="0"/>
                      <Component id="jComboBox5" min="-2" pref="276" max="-2" attributes="0"/>
                      <Group type="103" groupAlignment="0" max="-2" attributes="0">
                          <Component id="jCheckBox4" min="-2" max="-2" attributes="0"/>
                          <Component id="spinSlider1" alignment="0" max="32767" attributes="0"/>
                          <Component id="jComboBox3" alignment="0" max="32767" attributes="0"/>
                          <Component id="spinSlider1" alignment="0" min="-2" max="-2" attributes="0"/>
                      </Group>
                  </Group>
                  <EmptySpace max="32767" attributes="0"/>
                  <EmptySpace pref="88" max="32767" attributes="0"/>
              </Group>
          </Group>
        </DimensionLayout>
        <DimensionLayout dim="1">
          <Group type="103" groupAlignment="0" attributes="0">
              <Group type="102" alignment="0" attributes="0">
                  <EmptySpace max="-2" attributes="0"/>
              <Group type="102" alignment="1" attributes="0">
                  <EmptySpace pref="10" max="32767" attributes="0"/>
                  <Group type="103" groupAlignment="3" attributes="0">
                      <Component id="jComboBox5" alignment="3" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="3" attributes="0">
                      <Component id="jComboBox3" alignment="3" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -319,12 +330,32 @@
                      <Component id="jCheckBox4" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace max="32767" attributes="0"/>
                  <EmptySpace min="-2" pref="17" max="-2" attributes="0"/>
              </Group>
          </Group>
        </DimensionLayout>
      </Layout>
      <SubComponents>
        <Component class="javax.swing.JLabel" name="jLabel8">
          <Properties>
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
              <ResourceString bundle="cz/fidentis/analyst/gui/task/batch/registration/Bundle.properties" key="BatchRegistrationPanel.jLabel8.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
            </Property>
          </Properties>
        </Component>
        <Component class="javax.swing.JComboBox" name="jComboBox5">
          <Properties>
            <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
              <StringArray count="0"/>
            </Property>
          </Properties>
          <Events>
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jComboBox5ActionPerformed"/>
          </Events>
          <AuxValues>
            <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
          </AuxValues>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel6">
          <Properties>
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+220 −167

File changed.

Preview size limit exceeded, changes collapsed.

+11 −0
Original line number Diff line number Diff line
package cz.fidentis.analyst.gui.task.batch.registration;

/**
 * Describes the supported face similarity computation strategies.
 *
 * @author Marek Horský
 */
public enum FaceRegistrationStrategy {
    SEQUENTIAL,
    PARALLEL,
}
+11 −9
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@ import cz.fidentis.analyst.canvas.Canvas;
import cz.fidentis.analyst.data.face.StoredHumanFace;
import cz.fidentis.analyst.data.mesh.MeshModel;
import cz.fidentis.analyst.engines.face.batch.registration.BatchFaceRegistrationGPUImpl;
import cz.fidentis.analyst.engines.face.batch.registration.BatchFaceRegistrationServices;
import cz.fidentis.analyst.gui.elements.ProgressDialog;
import cz.fidentis.analyst.gui.task.batch.registration.BatchRegistrationPanel;
import cz.fidentis.analyst.opencl.OpenCLServices;
@@ -38,15 +37,18 @@ public class RegistrationTaskProvider implements CLResources {
     * @return batch registration task instance.
     */
    public SwingWorker<MeshModel, StoredHumanFace> getBatchRegistrationTask(ProgressDialog<MeshModel, StoredHumanFace> progressBar) {
        if (controlPanel.getRegistrationStrategy() == BatchFaceRegistrationServices.RegistrationStrategy.GPU_BATCH_REGISTRATION_PLACEHOLDER) {
        return switch(controlPanel.getFaceRegistrationStrategy()){
            case SEQUENTIAL -> new BatchCPURegistrationTask(progressBar, controlPanel, canvas);
            case PARALLEL -> getBatchGPURegistrationTask(progressBar);
        };
    }

    private BatchGPURegistrationTask getBatchGPURegistrationTask(ProgressDialog<MeshModel, StoredHumanFace> progressBar){
        if (batchFaceRegistrationGPU == null) {
            clContext = OpenCLServices.createContext();
            batchFaceRegistrationGPU = new BatchFaceRegistrationGPUImpl(clContext);
        }
        return new BatchGPURegistrationTask(progressBar, controlPanel, canvas, batchFaceRegistrationGPU);
        } else {
            return new BatchCPURegistrationTask(progressBar, controlPanel, canvas);
        }
    }

    @Override
+7 −6
Original line number Diff line number Diff line
@@ -9,17 +9,18 @@ BatchRegistrationPanel.jButton1.text=Compute
BatchRegistrationPanel.jButton4.text=Compute
BatchRegistrationPanel.jButton5.text=Export AVG face
BatchRegistrationPanel.jButton6.text=Export results
BatchRegistrationPanel.jCheckBox4.text=
BatchRegistrationPanel.jCheckBox5.text=Auto-crop
BatchRegistrationPanel.jLabel1.text=Template face:
BatchRegistrationPanel.jLabel2.text=Registration subsampling (0 = off):
BatchRegistrationPanel.jLabel3.text=Max. registration iterations:
BatchRegistrationPanel.jLabel4.text=Stabilization threshold:
BatchRegistrationPanel.jLabel5.text=Averaging method:
BatchRegistrationPanel.jLabel6.text=Registration method:
BatchRegistrationPanel.jLabel7.text=Scale faces during registration:
BatchRegistrationPanel.jPanel1.border.title=Averaging options
BatchRegistrationPanel.jPanel2.border.title_1=Dataset
BatchRegistrationPanel.jPanel3.border.title=Registration options
BatchRegistrationPanel.jPanel3.border.title_1=Similarity computation
BatchRegistrationPanel.jPanel4.border.title=Help
BatchRegistrationPanel.jCheckBox4.text=
BatchRegistrationPanel.jLabel7.text=Scale faces during registration:
BatchRegistrationPanel.jLabel2.text=Registration subsampling (0 = off):
BatchRegistrationPanel.jLabel6.text=Registration method:
BatchRegistrationPanel.jLabel8.text=Computation strategy:
BatchRegistrationPanel.jPanel3.border.title=Registration options