Around Farrowing

library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
library(ggplot2)
first <- read.csv("Z:/Isaac/Piglet_Detection/Around Farrowing/Cropped/Results/Sow_1_1st_detection_metrics.csv")
many <- read.csv("Z:/Isaac/Piglet_Detection/Around Farrowing/Cropped/Results/Sow_1_Many_detection_metrics.csv")
boxplot(first$area)

plot(first$area)

plot(first$centroid_x,first$centroid_y)

boxplot(first$width)

boxplot(many$area)

plot(many$area)

plot(many$centroid_x,many$centroid_y)

boxplot(many$width)

library(dplyr)
library(ggplot2)

many %>% 
  filter(score > 0.3) %>% 
  # filter(area < 15000) %>%
  # filter(x1 > 100) %>% # 1. Filter the data first
  ggplot(aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2)) + # 2. Start ggplot
    geom_rect(fill = NA, color = "red") + # 3. Add layers with +
    theme_dark() +
    labs(title = "Object Detection Bounding Boxes")

many %>% 
  filter(score > 0.3) %>% 
  filter(area < 15000) %>%
  # filter(x1 > 100) %>% # 1. Filter the data first
  ggplot(aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2)) + # 2. Start ggplot
    geom_rect(fill = NA, color = "red") + # 3. Add layers with +
    theme_dark() +
    labs(title = "Object Detection Bounding Boxes")

many %>% 
  filter(score > 0.3) %>% 
  filter(area < 15000) %>%
  filter(x1 > 100) %>% # 1. Filter the data first
  ggplot(aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2)) + # 2. Start ggplot
    geom_rect(fill = NA, color = "red") + # 3. Add layers with +
    theme_dark() +
    labs(title = "Object Detection Bounding Boxes")

first %>% 
  filter(score > 0.2) %>%
  # filter(area < 15000) %>%
  # filter(x1 > 100) %>% # 1. Filter the data first
  ggplot(aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2)) + # 2. Start ggplot
    geom_rect(fill = NA, color = "red") + # 3. Add layers with +
    theme_dark() +
    labs(title = "Object Detection Bounding Boxes")

first %>% 
  filter(score > 0.2) %>% 
  filter(area < 15000) %>%
  # filter(x1 > 100) %>% # 1. Filter the data first
  ggplot(aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2)) + # 2. Start ggplot
    geom_rect(fill = NA, color = "red") + # 3. Add layers with +
    theme_dark() +
    labs(title = "Object Detection Bounding Boxes")

first %>% 
  filter(score > 0.2) %>% 
  filter(area < 15000) %>%
  filter(x1 > 100) %>% # 1. Filter the data first
  ggplot(aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2)) + # 2. Start ggplot
    geom_rect(fill = NA, color = "red") + # 3. Add layers with +
    theme_dark() +
    labs(title = "Object Detection Bounding Boxes")

save(first,many,file="Z:/Isaac/Piglet_Detection/Around Farrowing/Cropped/Results/around_farrowing.RData")