CCTV telah diterapkan untuk memantau berbagai aktivitas di lingkungan Universitas Brawijaya, termasuk lalu lintas kendaraan di gerbang kampus. Pengawasan pada malam hari dalam kondisi intensitas cahaya yang rendah merupakan tantangan tersendiri dalam penggunaan CCTV. Hal ini dikarenakan kualitas gambar yang rendah sehingga menghambat kemampuan sistem untuk mendeteksi dan mengidentifikasi objek dengan tepat. Salah satu permasalahan yang timbul dalam kasus kurangnya pencahayaan adalah munculnya flare atau kesilauan yang disebabkan oleh lampu kendaraan yang mengarah langsung ke CCTV. Oleh karena itu, pada penelitian ini digunakan segmentasi U-Net dan restorasi inpaint untuk preproses data sebelum dilakukan deteksi objek menggunakan framework YOLOv5. Hasil pengujian deteksi objek diperoleh nilai precision 0.942, recall 0.873, dan F1-Score 0.88 pada model yang dipreproses menggunakan segmentasi U-Net dan restorasi inpaint. Nilai tersebut lebih tinggi sebesar 0.032 pada precision, 0.018 pada recall, dan 0.3 pada F1-Score jika dibandingkan dengan model yang tanpa preproses. Abstract CCTV has been implemented to monitor various activities within Brawijaya University, including vehicle traffic at the campus gate. Surveillance at night in low light intensity conditions is a challenge in the use of CCTV. This is due to the low image quality that hampers the system's ability to detect and identify objects correctly. One of the problems that arise in the case of lack of lighting is the appearance of flares or glare caused by vehicle lights that point directly to the CCTV. Therefore, in this research, U-Net segmentation and inpaint restoration are used to preprocess data before object detection using the YOLOv5 framework. The results of object detection testing obtained precision values of 0.942, recall 0.873, and F1-Score 0.88 on models preprocessed using U-Net segmentation and inpaint restoration. These values are higher by 0.032 in precision, 0.018 in recall, and 0.3 in F1-Score when compared to the model without preprocessing.