Commit b87b1c5e authored by Samuel John Gulinello's avatar Samuel John Gulinello Committed by Rohan Kumar
Browse files

remove image display

parent 044d5be2
Loading
Loading
Loading
Loading

.idea/modules.xml

0 → 100644
+8 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/.idea/group8.iml" filepath="$PROJECT_DIR$/.idea/group8.iml" />
    </modules>
  </component>
</project>
 No newline at end of file
+0 −3
Original line number Diff line number Diff line
@@ -16,9 +16,6 @@
    <div id="loading"></div>

    <div class="container" id="resultContainer">
        <div class="image-container" id="imageContainer">
            <!-- Placeholder for image -->
        </div>
        <div class="objects-container" id="objectsContainer">
            <h4 style="margin: 0;">Select An Object To View Point Cloud With That Object Highlighted</h4>
            <p style="margin: 0;"><em>point cloud can be manipulated through rotate and zoom</em></p>
+8 −14
Original line number Diff line number Diff line
async function fetchImageAndObjects() {
    try {
        const response = await fetch('http://127.0.0.1:5555/api/getObjects');
        const response = await fetch('http://127.0.0.1:5000/getImageAndObjects');
        if (!response.ok) {
            throw new Error('Failed to fetch image and objects');
        }
        const data = await response.json();
        console.log(data)
        displayImageAndObjects(data.imageUrl, data.objects);
        displayImageAndObjects(data.objects);
    } catch (error) {
        console.error(error);
    }
}

function displayImageAndObjects(imageUrl, objects) {
    const imageContainer = document.getElementById('imageContainer');
    const objectsContainer = document.getElementById('objectsContainer');
    const container = document.getElementById('resultContainer');

    // Create an image element
    const imageElement = document.createElement('img');
    console.log(imageUrl);
    imageElement.src = 'http://127.0.0.1:5555/' + imageUrl;
    imageElement.alt = 'Image';
    imageContainer.appendChild(imageElement);

    // Create a list for objects
    const objectsList = document.createElement('ul');
    objects.forEach(object => {
@@ -58,19 +49,22 @@ function displayLoading() {
function hideLoading() {
    loader.classList.remove("display");
}

async function startWorkflow(){
    const startButton = document.getElementById("process");
    startButton.style.display = "none";
    displayLoading();
    try {
        const response = await fetch('http://127.0.0.1:5555/runProcess');
        const response = await fetch('http://127.0.0.1:5000/runProcess');
        if (!response.ok) {
            throw new Error('Failed to fetch image and objects');
        }
        const data = await response;
        console.log(data);
        hideLoading();
    } catch (error) {
        console.error(error);
    }
    await fetchImageAndObjects();
    fetchImageAndObjects();
    
}
 No newline at end of file
+2 −7
Original line number Diff line number Diff line
async function drawPointCloud(object) {
  var button = document.getElementById("drawPC");
  button.style.display = 'none';

  await fetch('http://127.0.0.1:5555/getJSON')
  await fetch('http://127.0.0.1:5000/getJSON')
    .then(response => response.json())
    .then(responseText => {
      let pointCloudData = parseJSONToPointCloud(responseText, object);

      console.log(responseText)

      // Use three.js to render the point cloud
      let scene = new THREE.Scene();
      let camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);