Parcourir la source

Update of online MatchReference experiment

Jérôme BUISINE il y a 4 ans
Parent
commit
80ecc6bd29

+ 56 - 2
experimentConfig.default.js

@@ -41,10 +41,64 @@ export const mixins = {
 export const experiments = {
   MatchExtractsWithReference: {
     mixins: [mixins.ExperimentBaseExtracts],
-    defaultConfig: {},
+    defaultConfig: {
+      lockConfig: false,
+      showHoverBorder: true,
+      extractConfig: {
+        x: 4,
+        y: 4
+      }
+    },
     scenesConfig: {},
     availableScenes: {
-      whitelist: null,
+      whitelist: [
+        'p3d_arcsphere_800_800',
+        'p3d_bathroom_800_800',
+        'p3d_bedroom_800_800',
+        'p3d_bidir_800_800',
+        'p3d_bmw-m6_800_800',
+        'p3d_bunny-fur_800_800',
+        'p3d_car2_800_800',
+        'p3d_caustic_800_800',
+        'p3d_chopper-titan_800_800',
+        'p3d_classroom_800_800',
+        'p3d_coffee-splash_800_800',
+        'p3d_contemporary-bathroom_800_800',
+        'p3d_crown_800_800',
+        'p3d_dining-room_800_800',
+        'p3d_dragon_250_800_800',
+        'p3d_dragon_800_800',
+        'p3d_ecosys_800_800',
+        'p3d_ganesha_800_800',
+        'p3d_glass-of-water_800_800',
+        'p3d_glass_800_800',
+        'p3d_kitchen_800_800',
+        'p3d_lamp_800_800',
+        'p3d_landscape-view-0_800_800',
+        'p3d_landscape-view-1_800_800',
+        'p3d_landscape-view-2_800_800',
+        'p3d_landscape-view-3_800_800',
+        'p3d_landscape-view-4_800_800',
+        'p3d_living-room-2_800_800',
+        'p3d_living-room-3_800_800',
+        'p3d_living-room_800_800',
+        'p3d_pavilion-day_800_800',
+        'p3d_pavilion-night_800_800',
+        'p3d_sanmiguel_800_800',
+        'p3d_sanmiguel_cam18_800_800',
+        'p3d_sanmiguel_cam1_800_800',
+        'p3d_sanmiguel_cam3_800_800',
+        'p3d_staircase2_800_800',
+        'p3d_staircase_800_800',
+        'p3d_tt_800_800',
+        'p3d_tungsten_veach-mis_800_800',
+        'p3d_veach-ajar_800_800',
+        'p3d_villa-daylight_800_800',
+        'p3d_vw-van_800_800',
+        // 'p3d_water-caustic_800_800',
+        'p3d_whiteroom-daytime_800_800',
+        'p3d_whiteroom-night_800_800'
+      ],
       blacklist: null
       // No whitelist = Select all scenes
       // Whitelist = Only select some scenes

+ 1 - 1
src/App.vue

@@ -54,7 +54,7 @@
 
     <!-- Pages content -->
     <v-content>
-      <v-container fill-height>
+      <v-container fill-height style="padding-top:0px !important; padding-bottom:0px !important">
         <v-layout justify-center>
           <v-flex xs12>
             <v-scroll-x-reverse-transition mode="out-in">

+ 2 - 2
src/components/ExperimentBlock.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <v-container grid-list-md text-xs-center fluid>
+    <v-container grid-list-md text-xs-center fluid style="padding-top: 0px !important;">
       <v-layout row wrap>
         <!-- Experiment header -->
 
@@ -16,7 +16,7 @@
           -->
 
           <h2>Experiment "{{ $route.meta.fullName }}"</h2>
-          <h3>{{ sceneName }}</h3>
+          <!-- <h3>{{ sceneName }}</h3> -->
 
           <slot name="header"></slot>
         </v-flex>

+ 7 - 7
src/views/ExperimentValidated.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <h2>Experiment "{{ experimentFullName }}"</h2>
+    <h2>"{{ experimentFullName }}"</h2>
 
     <v-card>
       <v-card-title primary-title>
@@ -8,11 +8,9 @@
         <div class="headline">Experiment validated for the scene "{{ sceneName }}"</div>
         <v-spacer />
       </v-card-title>
-
-      <!--
       <v-card-actions>
         <v-spacer />
-        <v-btn flat exact to="/experiments/">
+        <!-- <v-btn flat exact to="/experiments/">
           <v-icon left>home</v-icon>
           Select another experiment
         </v-btn>
@@ -20,15 +18,15 @@
         <v-btn flat exact :to="`/experiments/${experimentName}`">
           <v-icon left>arrow_back</v-icon>
           Go back to scene selection
-        </v-btn>
-
+        </v-btn> -->
         <v-btn v-if="hasScenesLeft" flat exact :to="`/experiments/${experimentName}/${getRandomScene}`">
           <v-icon left>shuffle</v-icon>
           Continue with a random scene
         </v-btn>
+        <div v-if="!hasScenesLeft" class="headline">You finished all the scene, thanks for your contribution</div>
+
         <v-spacer />
       </v-card-actions>
-      !-->
     </v-card>
   </div>
 </template>
@@ -79,6 +77,8 @@ export default {
         scenesList.includes(aScene) &&
         this.progression[this.experimentName] &&
         !this.progression[this.experimentName][aScene].done)
+
+    this.$router.push(`/experiments/${this.experimentName}/${this.getRandomScene}`)
   }
 }
 </script>

+ 2 - 2
src/views/Experiments/MatchExtractsWithReference.vue

@@ -19,7 +19,7 @@
     <template v-slot:content>
       <v-flex xs12 sm6>
         <v-card dark color="primary" :max-width="maxWidth">
-          <v-card-text class="px-0">Experiment image</v-card-text>
+          <!-- <v-card-text class="px-0">Experiment image</v-card-text> -->
 
           <v-container class="pa-1">
             <template v-for="i in extractConfig.y">
@@ -67,7 +67,7 @@
       </v-flex>
       <v-flex sm6 xs12>
         <v-card dark color="primary" :max-width="maxWidth">
-          <v-card-text>Reference image</v-card-text>
+          <!-- <v-card-text>Reference image</v-card-text> -->
           <v-img v-if="referenceImage" :src="referenceImage" :max-height="maxHeight" :max-width="maxWidth" />
         </v-card>
       </v-flex>

+ 13 - 6
utils/extract_parts.py

@@ -13,7 +13,6 @@ def get_parts(img):
 
     parts = []
 
-
     h, w, c = img.shape
     h_block, w_block = image_block
     h_zone, w_zone = zone_block
@@ -26,26 +25,32 @@ def get_parts(img):
 
     # extract left up  image
     h_start = int((h % h_zone) / 2)
-    left_up_image = img[h_start:h_block+h_start, m_w-h_block:m_w]
+    w_start = int((w % w_zone) / 2)
+    left_up_image = img[h_start:h_block+h_start, w_start:w_start+w_block]
 
     parts.append(left_up_image)
 
     # extract middle up image
     h_start = int((h % h_zone) / 2)
+
     middle_up_image = img[h_start:h_block+h_start, m_w-m_w_img_block:m_w+m_w_img_block]
 
     parts.append(middle_up_image)
 
     # extract right up  image
     h_start = int((h % h_zone) / 2)
-    right_up_image = img[h_start:h_block+h_start, m_w:m_w+w_block]
-    
+    w_end = w - int((w % w_zone) / 2)
+
+    right_up_image = img[h_start:h_block+h_start, w_end-w_block:w_end]
+
     parts.append(right_up_image)
 
     # extract left bottom image
     h_end = h - int((h % h_zone) / 2)
     h_start = h_end - h_block
-    left_bottom_image = img[h_start:h_end, m_w-h_block:m_w]
+    w_start = int((w % w_zone) / 2)
+
+    left_bottom_image = img[h_start:h_end, w_start:w_start+w_block]
 
     parts.append(left_bottom_image)
 
@@ -60,7 +65,9 @@ def get_parts(img):
     # extract left bottom image
     h_end = h - int((h % h_zone) / 2)
     h_start = h_end - h_block
-    right_bottom_image = img[h_start:h_end, m_w:m_w+w_block]
+    w_end = w - int((w % w_zone) / 2)
+
+    right_bottom_image = img[h_start:h_end,  w_end-w_block:w_end]
 
     parts.append(right_bottom_image)