Comments (1)
Yes, but the points on the original image don't need to be a set of unique points. In other words, detected lanes with less of 128x128 points will have repeated points in the descriptor. The descriptor extractions works as a pixel-level regularization strategy, where relevant information is extracted from the RGB image regardless of the lane position, shape and pixel number.
The detailed strategy for descriptor is explained in the extract_descriptor
method:
def extract_descriptors(label, image):
# avoids problems in the sampling
eps = 0.01
# The labels indices are not contiguous e.g. we can have index 1, 2, and 4 in an image
# For this reason, we should construct the descriptor array sequentially
inputs = torch.zeros(0, 3, DESCRIPTOR_SIZE, DESCRIPTOR_SIZE)
if torch.cuda.is_available():
inputs = inputs.cuda()
# This is needed to keep track of the lane we are classifying
mapper = {}
classifier_index = 0
# Iterating over all the possible lanes ids
for i in range(1, NUM_CLASSES_SEGMENTATION):
# This extracts all the points belonging to a lane with id = i
single_lane = label.eq(i).view(-1).nonzero().squeeze()
# As they could be not continuous, skip the ones that have no points
if single_lane.numel() == 0:
continue
# Points to sample to fill a squared desciptor
sample = torch.zeros(DESCRIPTOR_SIZE * DESCRIPTOR_SIZE)
if torch.cuda.is_available():
sample = sample.cuda()
sample = sample.uniform_(0, single_lane.size()[0] - eps).long()
sample, _ = sample.sort()
# These are the points of the lane to select
points = torch.index_select(single_lane, 0, sample)
# First, we view the image as a set of ordered points
descriptor = image.squeeze().view(3, -1)
# Then we select only the previously extracted values
descriptor = torch.index_select(descriptor, 1, points)
# Reshape to get the actual image
descriptor = descriptor.view(3, DESCRIPTOR_SIZE, DESCRIPTOR_SIZE)
descriptor = descriptor.unsqueeze(0)
# Concatenate to get a batch that can be processed from the other network
inputs = torch.cat((inputs, descriptor), 0)
# Track the indices
mapper[classifier_index] = i
classifier_index += 1
return inputs, mapper
descriptors, index_map = extract_descriptors(out_segmentation, im_tensor)
Please tell me if something is still unclear :)
from cascade-ld.
Related Issues (16)
- Can you release the code for training? HOT 13
- How to pretrain ERFNet HOT 3
- [extract_descriptors] function failing when number of points belonging to a lane is zero
- MORE INFO ON LICENSE
- can you provide train code?
- More information about LCNet HOT 3
- Train Code?
- A issue about the lane line pixel coordinates
- Running the main ipython script HOT 1
- I am confused with some details in the paper and looking forward to your code for training HOT 2
- Can you explain the loss function used for training ? what are the steps you followed for data pre-processing and what does the shape and the label look like. HOT 9
- About the double line HOT 1
- About Tusimple test dataset HOT 1
- Creating a {descriptor, class} object dataset HOT 6
- How can the segmentation network discriminate different lanes? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cascade-ld.